added "watchdog" script
Signed-off-by: K. Lux <k.lux@posteo.de>
This commit is contained in:
parent
7a16104c96
commit
79176eb1b0
1 changed files with 10 additions and 0 deletions
10
telebot_watchdog
Normal file
10
telebot_watchdog
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
count=$(ps aux | grep HSMensaW_bot.py | grep -c -v grep)
|
||||
if [ "$count" -gt 1 ]; then
|
||||
kill `ps axo pid,command | grep HSMensaW | grep -v grep | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f1 | tr '\n' ' '`
|
||||
fi
|
||||
if [ "$count" -lt 1 ]; then
|
||||
cd /home/pi/scripts || exit
|
||||
python3 HSMensaW_bot.py &
|
||||
fi
|
||||
|
Loading…
Reference in a new issue