From c5caf937cc566085957d176aea035f38a6e3c6d9 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Mon, 17 Jun 2019 10:44:20 +0200 Subject: [PATCH] allow kill/stop/suspend when blocked --- bashbot.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index 6fb9a65..93e7c70 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -11,7 +11,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.94-dev2-0-g0497513 +#### $$VERSION$$ v0.94-dev2-4-gd4f415f # # Exit Codes: # - 0 sucess (hopefully) @@ -698,11 +698,15 @@ if [ ! -f "${JSONSHFILE}" ]; then chmod +x "${JSONSHFILE}" fi -if [ "${SOURCE}" != "yes" ] && [ "$1" != "init" ] && [ "$1" != "help" ] && [ "$1" != "" ]; then +if [ "${SOURCE}" != "yes" ] && [ "$1" != "init" ] && [ "$1" != "help" ]; then ME="$(getBotName)" if [ "$ME" = "" ]; then - echo -e "${RED}ERROR: Can't connect to Telegram Bot! May be your TOKEN is invalid ...${NC}" - exit 1 + echo -e "${RED}ERROR: Can't connect to Telegram! Your TOKEN is invalid or you are blocked by ${URL%/*} ...${NC}" + case "$1" in + "" | "stop" | "kill"* | "suspendb"* ) # warn, but do not exit + echo -e "${RED}Ignored to continue for $1 ... ${NC}";; + *) exit 1;; + esac fi fi