Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Created December 2, 2017 17:03
Show Gist options
  • Save clamytoe/d3c0cf58059130031511abfa5c873fe9 to your computer and use it in GitHub Desktop.
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.
#!/bin/bash
ps awxx | grep $1 | grep -v get_pid | grep -v grep | awk '{print $1}'
#!/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