I want to convert my shell script to a web application. My script is written below. I want to have some text box for reading the input from the user. Then execute the script on that same server.
Script actually want to accept a path from the user and giving permission. First I need to check whether the directory is available or not. Then, If the directory is found. Give the permission else Print not found message.
Which is the simple solution for doing ?
echo -n "Enter the path for getting permission"
read input
echo "you entered $input"
if [ -d $input ]
then
echo "Directory found"
chmod -R 650 $input
echom "Done !!!"
else
echo "Not Found"
fi
Aucun commentaire:
Enregistrer un commentaire