Created
June 17, 2022 22:06
-
-
Save sumonst21/9fc5452b4344ef1c9eddf29304efb011 to your computer and use it in GitHub Desktop.
for a client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inotifywait -m ~/public_html -e create -e moved_to -e modify | | |
while read directory action file; do | |
if [[ "$file" =~ .*php$ ]] || [[ "$file" =~ .*htaccess$ ]]; then | |
echo "File $file was $action" >> ~/watch.log | |
~/watchit.sh | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/public_html | |
git fetch origin master | |
git reset --hard origin/master | |
time=`date +%Y-%m-%d.%H:%M:%S` | |
echo $time >> ~/watchit.log | |
find ~/public_html -type f -perm 0444 -name ".htaccess" -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment