diff --git a/bashbot.sh b/bashbot.sh index f055022..af83107 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -12,7 +12,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.80-pre-1-gb8ae9ec +#### $$VERSION$$ v0.80-pre-2-g9482bd6 # # Exit Codes: # - 0 sucess (hopefully) @@ -364,8 +364,9 @@ start_bot() { [[ "${DEBUG}" = *"debug" ]] && exec &>>"DEBUG.log" [ "${DEBUG}" != "" ] && date && echo "Start BASHBOT in Mode \"${DEBUG}\"" [[ "${DEBUG}" = "xdebug"* ]] && set -x - #cleaup old pipes + #cleaup old pipes and empty logfiles find "${TMPDIR}" -type p -delete + find "${TMPDIR}" -size 0 -name "*.log" -delete while true; do UPDATE="$(getJson "$UPD_URL$OFFSET" | "${JSONSHFILE}" -s -b -n)" diff --git a/modules/background.sh b/modules/background.sh index 917ab31..d48e9de 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -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.80-pre-0-gdd7c66d +#### $$VERSION$$ v0.80-pre-2-g9482bd6 # source from commands.sh if you want ro use interactive or background jobs @@ -48,6 +48,7 @@ start_back() { # $3 prefix start_proc() { [ "$2" = "" ] && return + [ -x "${2%% *}" ] || return 1 local fifo; fifo="${TMPDIR:-.}/$(procname "$1" "$3")" kill_proc "$1" "$3" mkfifo "${fifo}" diff --git a/mycommands.sh b/mycommands.sh index e1adfed..b5e5ea2 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -2,7 +2,7 @@ # files: mycommands.sh.dist # copy to mycommands.sh and add all your commands and functions here ... # -#### $$VERSION$$ v0.80-pre-0-gdd7c66d +#### $$VERSION$$ v0.80-pre-2-g9482bd6 # # uncomment the following lines to overwrite info and help messages @@ -30,7 +30,7 @@ if [ "$1" != "source" ];then '/question'*) # start interactive questions checkproc if [ "$res" -gt 0 ] ; then - startproc "examples/question.sh" + startproc "examples/question.sh" || _message "Can't start question." else send_normal_message "${CHAT[ID]}" "$MESSAGE already running ..." fi @@ -39,7 +39,7 @@ if [ "$1" != "source" ];then '/run_notify'*) # start notify background job myback="notify"; checkback "$myback" if [ "$res" -gt 0 ] ; then - background "examples/notify.sh 60" "$myback" # notify every 60 seconds + background "examples/notify.sh 60" "$myback" || _message "Can't start notify." else send_normal_message "${CHAT[ID]}" "Background command $myback already running ..." fi