diff --git a/bashbot.sh b/bashbot.sh index d3cd695..e704ac3 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb # 8 - curl/wget missing # 10 - not bash! # -#### $$VERSION$$ v1.45-dev-44-g17efeeb +#### $$VERSION$$ v1.45-dev-48-gf4d45d8 ################################################################## # are we running in a terminal? @@ -912,7 +912,7 @@ if [ -z "${SOURCE}" ]; then exit ;; # suspend, resume or kill background jobs - "suspendb"*|"resumeb"*|"killb"*) + "suspendb"*|"resumeb"*|'restartb'*|"killb"*) _is_function job_control || { printf "${RED}Module background is not available!${NN}"; exit 3; } ME="$(getConfigKey "botname")" job_control "$1" diff --git a/examples/webhook/README.md b/examples/webhook/README.md index 0f45761..7932357 100644 --- a/examples/webhook/README.md +++ b/examples/webhook/README.md @@ -50,7 +50,7 @@ Webhook works without running Bashbot and thus has the following limitations: To run startup actions and `TIMER_EVENTS` run Bashbot with `./bashbot start` even not needed with webhook. -Workaround for running new background jobs is to execute `./bashbot.sh restartback` on the command line after starting a new background job. +Workaround for running new background jobs is to execute `./bashbot.sh resumeback` on the command line after starting a new background job. #### Enable webhook on Telegram side @@ -88,5 +88,5 @@ and read updates from the named pipe `data-bot-bash/webhook-fifo-`, sim But the default webhook method is so convincing and responsive that a special high traffic mode is not necessary. -#### $$VERSION$$ v1.45-dev-47-gf4323e4 +#### $$VERSION$$ v1.45-dev-48-gf4d45d8 diff --git a/modules/background.sh b/modules/background.sh index bfd0ec9..c5720be 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -6,7 +6,7 @@ # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # # shellcheck disable=SC1117,SC2059 -#### $$VERSION$$ v1.45-dev-46-gc57e927 +#### $$VERSION$$ v1.45-dev-48-gf4d45d8 # will be automatically sourced from bashbot @@ -125,10 +125,7 @@ inproc() { } # start stop all jobs -# $1 command -# killb* -# suspendb* -# resumeb* +# $1 command # kill suspend resume restart job_control() { local BOT ADM content proc CHAT job fifo killall="" BOT="$(getConfigKey "botname")" @@ -144,20 +141,20 @@ job_control() { fifo="$(procname "${CHAT}" "${job}")" debug_checks "Execute job_control" "$1" "${FILE##*/}" case "$1" in - "resumeb"*|"backgr"*) + "resume"*|"restart"*) printf "Restart Job: %s %s\n" "${proc}" " ${fifo##*/}" restart_back "${CHAT}" "${proc}" "${job}" # inform botadmin about stop [ -n "${ADM}" ] && send_normal_message "${ADM}" "Bot ${BOT} restart background jobs ..." & ;; - "suspendb"*) + "suspend"*) printf "Suspend Job: %s %s\n" "${proc}" " ${fifo##*/}" kill_proc "${CHAT}" "${job}" # inform botadmin about stop [ -n "${ADM}" ] && send_normal_message "${ADM}" "Bot ${BOT} suspend background jobs ..." & killall="y" ;; - "killb"*) + "kill"*) printf "Kill Job: %s %s\n" "${proc}" " ${fifo##*/}" kill_proc "${CHAT}" "${job}" rm -f "${FILE}" # remove job