mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-31 22:01:46 +00:00
final debug msgs
This commit is contained in:
parent
ca765afa32
commit
487deee08c
@ -81,7 +81,7 @@ export BASHBOTDEBUG
|
|||||||
debug_checks(){
|
debug_checks(){
|
||||||
[ -n "${BASHBOTDEBUG}" ] && return
|
[ -n "${BASHBOTDEBUG}" ] && return
|
||||||
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! =========="
|
||||||
|
@ -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-4-g9b1119d
|
#### $$VERSION$$ v0.98-0-g5b5447e
|
||||||
|
|
||||||
# will be automatically sourced from bashbot
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ job_control() {
|
|||||||
local BOT ADM content proc CHAT job fifo killall=""
|
local BOT ADM content proc CHAT job fifo killall=""
|
||||||
BOT="$(getConfigKey "botname")"
|
BOT="$(getConfigKey "botname")"
|
||||||
ADM="$(getConfigKey "botadmin")"
|
ADM="$(getConfigKey "botadmin")"
|
||||||
debug_checks "Enter job_control" "${1}" "${FILE##*/}"
|
debug_checks "Enter job_control" "${1}"
|
||||||
for FILE in "${DATADIR:-.}/"*-back.cmd; do
|
for FILE in "${DATADIR:-.}/"*-back.cmd; do
|
||||||
[ "${FILE}" = "${DATADIR:-.}/*-back.cmd" ] && echo -e "${RED}No background processes.${NC}" && break
|
[ "${FILE}" = "${DATADIR:-.}/*-back.cmd" ] && echo -e "${RED}No background processes.${NC}" && break
|
||||||
content="$(< "${FILE}")"
|
content="$(< "${FILE}")"
|
||||||
@ -135,6 +135,7 @@ job_control() {
|
|||||||
proc="${job#*:}"
|
proc="${job#*:}"
|
||||||
job="${job%:*}"
|
job="${job%:*}"
|
||||||
fifo="$(procname "${CHAT}" "${job}")"
|
fifo="$(procname "${CHAT}" "${job}")"
|
||||||
|
debug_checks "Execute 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##*/}"
|
||||||
|
Loading…
Reference in New Issue
Block a user