Skip to content

Instantly share code, notes, and snippets.

@wgm89
Created June 6, 2019 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wgm89/0c7c811f89ab68487195677387c2d652 to your computer and use it in GitHub Desktop.
Save wgm89/0c7c811f89ab68487195677387c2d652 to your computer and use it in GitHub Desktop.
监控脚本
#!/bin/sh
#=====================
while :
do
echo "Current DIR is " $PWD
stillRunning=$(ps -ef |grep "/data/wwwroot/lottery_v2/CORE/think auto" |grep -v "grep")
if [ "$stillRunning" ] ; then
echo "running..."
else
echo "restart ..."
/usr/local/php/bin/php /data/wwwroot/lottery_v2/CORE/think auto
echo "TWS service was exited!"
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment