#! /bin/shecho"*************************************"echo"1.set password for folder/file."echo"2.remove password from folder/file."echo"0.quit."echo"*************************************"read ch
case$chin
1)echo"please input your folder/file name:"whileread name
doif[ -d "$name"];thenecho"This is a folder."zip -re $name.zip $namerm -rf $nameecho"encryption success!"breakelif[ -f "$name"];thenecho"This is a file."
gpg -c $namerm -f $nameecho"encryption success!"breakelseecho"the file does not exist,please input again:"fidone;;
2)echo"please input your folder/file name:"whileread name
doif[ -f "$name"];then
unzip $name;breakelif[ -f "$name.gpg"]then
gpg $name.gpg
breakelseecho"the folder/file does not exist,please input again:"fidone;;
3)exit;;
esac