#  It is recommended to test the script on a local machine for its purpose and effects.
#  ManageEngine Endpoint Central will not be responsible for any
#  damage/loss to the data/setup based on the behavior of the script.
#  Description - Script to change permission for Folder/File
#  Parameters - "<Folder/File Path>" "<F/R/W>"
#  Example - "myfile.txt" "u+rwx"
#  Example - "/Applications/mydirectory/logs" "g-w"
#  Configuration Type - USER/COMPUTER  

if [ $# == '2' ]; then

path=$1
permission=$2
chmod "$2" "$1"
ret=$?
if [ $ret == "0" ]; then
echo "Permission Changed"
else
echo "Error in Changing Permission"
fi
exit $ret

else
echo "Invalid Arguments - Please refer description of the script"
exit 1
fi
