From 6a3ae1bbf097036a15164971241441c4f4e70885 Mon Sep 17 00:00:00 2001 From: celso Date: Tue, 21 Mar 2023 18:44:50 -0300 Subject: [PATCH] fix bug caused by stopping bot while not running --- bot.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.sh b/bot.sh index 4b4f742..f7f1d55 100755 --- a/bot.sh +++ b/bot.sh @@ -1,5 +1,8 @@ #!/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 api_url="https://api.telegram.org/bot${TELEGRAM_DNS_TOKEN}/"