start: show already running bot

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-02-01 09:02:22 +01:00
parent e4a983b16f
commit c1aec9285e
1 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing # 8 - curl/wget missing
# 10 - not bash! # 10 - not bash!
# #
#### $$VERSION$$ v1.40-dev-17-g8034a5f #### $$VERSION$$ v1.40-dev-24-ge4a983b
################################################################## ##################################################################
# emmbeded system may claim bash but it is not # emmbeded system may claim bash but it is not
@ -799,12 +799,13 @@ if [ -z "${SOURCE}" ]; then
BOTPID="$(proclist "${SESSION}")" BOTPID="$(proclist "${SESSION}")"
if _is_function process_update; then if _is_function process_update; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
[ -n "${BOTPID}" ] && kill ${BOTPID} [ -n "${BOTPID}" ] && kill ${BOTPID} && printf "${GREY}Stop already running bot ...${NN}"
nohup "${SCRIPT}" "startbot" "$2" "${SESSION}" &>/dev/null & nohup "${SCRIPT}" "startbot" "$2" "${SESSION}" &>/dev/null &
printf "Session Name: %s\n" "${SESSION}" printf "Session Name: %s\n" "${SESSION}"
sleep 1 sleep 1
else else
printf "${ORANGE}Update processing disabled, bot can only send messages.${NN}" printf "${ORANGE}Update processing disabled, bot can only send messages.${NN}"
[ -n "${BOTPID}" ] && printf "${ORANGE}Already running bot found ...${NN}"
fi fi
if [ -n "$(proclist "${SESSION}")" ]; then if [ -n "$(proclist "${SESSION}")" ]; then
printf "${GREEN}Bot started successfully.${NN}" printf "${GREEN}Bot started successfully.${NN}"