diff --git a/bashbot.sh b/bashbot.sh index 29b18f7..f40f96a 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.98-pre2-11-ge6de382 +#### $$VERSION$$ v0.98-pre2-13-g0e6712a # # Exit Codes: # - 0 success (hopefully) @@ -81,10 +81,10 @@ debug_checks(){ local DATE WHERE MYTOKEN; DATE="$(date)"; WHERE="${1}"; shift printf "%s: debug_checks: %s: bashbot.sh %s\n" "${DATE}" "${WHERE}" "$*" MYTOKEN="$(getConfigKey "bottoken")" - [ -z "${MYTOKEN}" ] && printf "%s: %s\n" "${DATE}" "Bot token is missing!" - check_token "${MYTOKEN}" || printf "%s: %s\n" "${DATE}" "Invalid bot token!" - [ -z "$(getConfigKey "botadmin")" ] && printf "%s: %s\n" "${DATE}" "Bot admin is missing!" - [ -f ".jssh" ] && printf "%s: %s\n" "${DATE}" "Ups, found file \"${PWD:-.}/.jssh\"!" + [ -z "${MYTOKEN}" ] && printf "%s: %s\n" "${DATE}" "Bot token is missing! ==========" + check_token "${MYTOKEN}" || printf "%s: %s\n" "${DATE}" "Invalid bot token! ==========" + [ -z "$(getConfigKey "botadmin")" ] && printf "%s: %s\n" "${DATE}" "Bot admin is missing! ==========" + [ -f ".jssh" ] && printf "%s: %s\n" "${DATE}" "Ups, found file \"${PWD:-.}/.jssh\"! ==========" } >>"${DEBUGLOG}" # get location and name of bashbot.sh @@ -347,6 +347,7 @@ killallproc() { # shellcheck disable=SC2046 [ -n "${procid}" ] && kill $(proclist -9 "$1") fi + debug_checks "end killallproc" "${1}" } diff --git a/modules/background.sh b/modules/background.sh index 2c5d0eb..9946a32 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -5,7 +5,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.98-pre2-0-ga597303 +#### $$VERSION$$ v0.98-pre2-13-g0e6712a # will be automatically sourced from bashbot @@ -134,6 +134,7 @@ job_control() { proc="${job#*:}" job="${job%:*}" fifo="$(procname "${CHAT}" "${job}")" + debug_checks "start job_control" "${1}" "${FILE}" case "$1" in "resumeb"*|"backgr"*) printf "Restart Job: %s %s\n" "${proc}" " ${fifo}" @@ -160,6 +161,7 @@ job_control() { # send message only onnfirst job ADM="" done + debug_checks "end job_control" "${1}" # kill all requestet. kill ALL background jobs, even not listed in data-bot-bash [ "${killall}" = "y" ] && killallproc "back-" }