make kill inotify optional on shutdown

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-05-15 12:10:20 +02:00
parent ac9ca6049e
commit b1d569a679

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# description: Start or stop telegram-bash-bot # description: Start or stop telegram-bash-bot
# #
#### $$VERSION$$ v0.94-pre-0-gac2ec02 #### $$VERSION$$ v0.94-pre-11-gac9ca60
# shellcheck disable=SC2009 # shellcheck disable=SC2009
# shellcheck disable=SC2181 # shellcheck disable=SC2181
@ -76,8 +76,9 @@ case "$1" in
'suspendback'|'resumeback'|'killback') 'suspendback'|'resumeback'|'killback')
$runcmd "$start $1" $runcmd "$start $1"
RETVAL=$? RETVAL=$?
# kill inotifywait from runuser # kill inotifywait from runuser if long running bg scripts use it
if [ "$1" != "resumeback" ]; then KILLINOTIFY=""
if [ "$1" != "resumeback" ] && [ -n "${KILLINOTIFY}" ]; then
kill -9 "$(ps -u "$runas" | grep inotifywait | sed 's/ .*//')" >/dev/null 2>&1 kill -9 "$(ps -u "$runas" | grep inotifywait | sed 's/ .*//')" >/dev/null 2>&1
fi fi
;; ;;