From 7b2e1957e385f9002303892ec2721d23c0cfb3ee Mon Sep 17 00:00:00 2001 From: Lawrence Liu Date: Fri, 10 May 2024 16:34:03 -0700 Subject: [PATCH] autostartbot --- autoStartBot.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 autoStartBot.sh diff --git a/autoStartBot.sh b/autoStartBot.sh new file mode 100755 index 0000000..5169be8 --- /dev/null +++ b/autoStartBot.sh @@ -0,0 +1,15 @@ +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 +