Created
July 18, 2014 17:29
-
-
Save shanemhansen/b4b2a9a92fdacf2798d8 to your computer and use it in GitHub Desktop.
watch deamonize
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/bash | |
PIDFILE="na.pid" | |
nohup ./netacuity_server "$1" & | |
sleep 1 | |
while test -e "$PIDFILE" ; do | |
if kill -0 $(cat $PIDFILE) 2>/dev/null; then | |
continue | |
else | |
echo "graceful shutdown" | |
exit | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment