Skip to content

Commit

Permalink
final debug msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
gnadelwartz committed Jul 4, 2020
1 parent ca765af commit 487deee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bashbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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! =========="
Expand Down
5 changes: 3 additions & 2 deletions modules/background.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}")"
Expand All @@ -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##*/}"
Expand Down

0 comments on commit 487deee

Please sign in to comment.