Skip to content

Instantly share code, notes, and snippets.

@tanishiking
Created June 4, 2016 06:08
Show Gist options
  • Save tanishiking/2b4130fdbb9f7ab9df7c08c7f07de19d to your computer and use it in GitHub Desktop.
Save tanishiking/2b4130fdbb9f7ab9df7c08c7f07de19d to your computer and use it in GitHub Desktop.
簡易的なプロセス死活監視スクリプト
#!/usr/bin/sh
process=""
while true; do
is_alive=`ps aux | grep "$process" | grep -v grep | wc -l`
if [[ $is_alive -eq 0 ]]; then
echo "process dead!!!!"
break
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment