From 487deee08cd4e69cb6ad537cfcfefdf8e3cf75a0 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sat, 4 Jul 2020 09:18:28 +0200 Subject: [PATCH] final debug msgs --- bashbot.sh | 2 +- modules/background.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index 2f30481..26196c4 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -81,7 +81,7 @@ export BASHBOTDEBUG debug_checks(){ [ -n "${BASHBOTDEBUG}" ] && return local DATE WHERE MYTOKEN; DATE="$(date)"; WHERE="${1}"; shift - printf "%s: debug_checks: %s: bashbot.sh %s\n" "${DATE}" "${WHERE}" "$*" + 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! ==========" diff --git a/modules/background.sh b/modules/background.sh index 255f9ad..c7a4d4d 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-4-g9b1119d +#### $$VERSION$$ v0.98-0-g5b5447e # will be automatically sourced from bashbot @@ -126,7 +126,7 @@ job_control() { local BOT ADM content proc CHAT job fifo killall="" BOT="$(getConfigKey "botname")" ADM="$(getConfigKey "botadmin")" - debug_checks "Enter job_control" "${1}" "${FILE##*/}" + debug_checks "Enter job_control" "${1}" for FILE in "${DATADIR:-.}/"*-back.cmd; do [ "${FILE}" = "${DATADIR:-.}/*-back.cmd" ] && echo -e "${RED}No background processes.${NC}" && break content="$(< "${FILE}")" @@ -135,6 +135,7 @@ job_control() { proc="${job#*:}" job="${job%:*}" fifo="$(procname "${CHAT}" "${job}")" + debug_checks "Execute job_control" "${1}" "${FILE##*/}" case "$1" in "resumeb"*|"backgr"*) printf "Restart Job: %s %s\n" "${proc}" " ${fifo##*/}"