Created
December 2, 2017 17:03
-
-
Save clamytoe/d3c0cf58059130031511abfa5c873fe9 to your computer and use it in GitHub Desktop.
Scripts that I use to keep my Slack bot running if it gets disconnected.
This file contains 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 | |
ps awxx | grep $1 | grep -v get_pid | grep -v grep | awk '{print $1}' |
This file contains 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 | |
while : | |
do | |
pid=`/home/mohh/bin/get_pid.sh mohhsbot.py` | |
if [ $pid -gt 0 ] | |
then | |
continue | |
else | |
clear | |
echo "Starting MohhsBot..." | |
python /home/mohh/Projects/MohhsBot/mohhsbot.py | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment