Drupal Git commit script with database

check script path
echo $PATH
create according file
vim script-name.sh
#!/bin/bash
#script to add commint to git
#with umped db copy
#script will stop its execution if it fail
set -e
cd /var/www/prm
#clear cache
drush cc all
if [ $? -eq 0 ]; then
echo "Cache clear"
else
echo FAIL
exit
fi
#database dump
drush sql-dump > db-backup/prm.sql
if [ $? -eq 0 ]; then
echo "Database dumped sucessfully"
else
echo FAIL
exit
fi
git add .
git status
echo -n "Please add a note to commit:"
read note
git commit -m "$note"
echo "Done"

update permission
chmod 711script-name.sh