fix bug caused by stopping bot while not running
This commit is contained in:
parent
b99ae05874
commit
6a3ae1bbf0
5
bot.sh
5
bot.sh
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
[ "${1}" == "stop" ] && kill -SIGTERM "$(cat /tmp/tpdnsbot.pid)" 2>/dev/null && exit 0
|
[ "${1}" == "stop" ] && {
|
||||||
|
kill -SIGTERM "$(cat /tmp/tpdnsbot.pid)" 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
printf "%s" "${$}" > /tmp/tpdnsbot.pid
|
printf "%s" "${$}" > /tmp/tpdnsbot.pid
|
||||||
|
|
||||||
api_url="https://api.telegram.org/bot${TELEGRAM_DNS_TOKEN}/"
|
api_url="https://api.telegram.org/bot${TELEGRAM_DNS_TOKEN}/"
|
||||||
|
|
Loading…
Reference in New Issue