mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-29 05:02:46 +00:00
more places with debug_checks
This commit is contained in:
parent
0e6712a599
commit
4b3363f603
11
bashbot.sh
11
bashbot.sh
@ -11,7 +11,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.98-pre2-11-ge6de382
|
#### $$VERSION$$ v0.98-pre2-13-g0e6712a
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 success (hopefully)
|
# - 0 success (hopefully)
|
||||||
@ -81,10 +81,10 @@ debug_checks(){
|
|||||||
local DATE WHERE MYTOKEN; DATE="$(date)"; WHERE="${1}"; shift
|
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")"
|
MYTOKEN="$(getConfigKey "bottoken")"
|
||||||
[ -z "${MYTOKEN}" ] && printf "%s: %s\n" "${DATE}" "Bot token is missing!"
|
[ -z "${MYTOKEN}" ] && printf "%s: %s\n" "${DATE}" "Bot token is missing! =========="
|
||||||
check_token "${MYTOKEN}" || printf "%s: %s\n" "${DATE}" "Invalid bot token!"
|
check_token "${MYTOKEN}" || printf "%s: %s\n" "${DATE}" "Invalid bot token! =========="
|
||||||
[ -z "$(getConfigKey "botadmin")" ] && printf "%s: %s\n" "${DATE}" "Bot admin is missing!"
|
[ -z "$(getConfigKey "botadmin")" ] && printf "%s: %s\n" "${DATE}" "Bot admin is missing! =========="
|
||||||
[ -f ".jssh" ] && printf "%s: %s\n" "${DATE}" "Ups, found file \"${PWD:-.}/.jssh\"!"
|
[ -f ".jssh" ] && printf "%s: %s\n" "${DATE}" "Ups, found file \"${PWD:-.}/.jssh\"! =========="
|
||||||
} >>"${DEBUGLOG}"
|
} >>"${DEBUGLOG}"
|
||||||
|
|
||||||
# get location and name of bashbot.sh
|
# get location and name of bashbot.sh
|
||||||
@ -347,6 +347,7 @@ killallproc() {
|
|||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
[ -n "${procid}" ] && kill $(proclist -9 "$1")
|
[ -n "${procid}" ] && kill $(proclist -9 "$1")
|
||||||
fi
|
fi
|
||||||
|
debug_checks "end killallproc" "${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# 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
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
@ -134,6 +134,7 @@ job_control() {
|
|||||||
proc="${job#*:}"
|
proc="${job#*:}"
|
||||||
job="${job%:*}"
|
job="${job%:*}"
|
||||||
fifo="$(procname "${CHAT}" "${job}")"
|
fifo="$(procname "${CHAT}" "${job}")"
|
||||||
|
debug_checks "start job_control" "${1}" "${FILE}"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"resumeb"*|"backgr"*)
|
"resumeb"*|"backgr"*)
|
||||||
printf "Restart Job: %s %s\n" "${proc}" " ${fifo}"
|
printf "Restart Job: %s %s\n" "${proc}" " ${fifo}"
|
||||||
@ -160,6 +161,7 @@ job_control() {
|
|||||||
# send message only onnfirst job
|
# send message only onnfirst job
|
||||||
ADM=""
|
ADM=""
|
||||||
done
|
done
|
||||||
|
debug_checks "end job_control" "${1}"
|
||||||
# kill all requestet. kill ALL background jobs, even not listed in data-bot-bash
|
# kill all requestet. kill ALL background jobs, even not listed in data-bot-bash
|
||||||
[ "${killall}" = "y" ] && killallproc "back-"
|
[ "${killall}" = "y" ] && killallproc "back-"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user