chatbot/autoStartBot.sh

16 lines
333 B
Bash
Raw Normal View History

2024-05-10 16:34:03 -07:00
touch AUTOLOG
pwd > AUTOLOG
date >> AUTOLOG
whoami >> AUTOLOG
np=`ps -aux | grep dialoggptBot | wc -l`
echo $np >> AUTOLOG
if [[ "$np" != "2" ]]
then
echo "Restarting chatbot..."
pkill -9 -f dialoggptBot
sleep 15s
nohup /home/lawrence/anaconda3/bin/python /home/lawrence/chatbot/dialoggptBot.py > /dev/null 2>&1
echo "Done"
fi