Last active
August 29, 2015 14:21
-
-
Save 178inaba/2aebd37ae129c7a524e8 to your computer and use it in GitHub Desktop.
ディレクトリ/ファイルを監視してsupervisorで再起動(自動化 ref: http://qiita.com/inaba178/items/f2599b75816f8b779043
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
#!/bin/sh | |
if [[ $# -ne 3 ]] ; then | |
echo argument is invalid. | |
exit | |
fi | |
while : | |
do | |
after=`ls -l $1` | |
if [[ $after != $before && $before != "" ]] ; then | |
supervisorctl restart $2 > /dev/null | |
fi | |
before=$after | |
sleep $3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment