diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 0d9362b4c..a9dd54b35 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -208,7 +208,7 @@ fi ./reader.lua "$@" 2> crash.log # clean up our own process tree in case the reader crashed (if needed, to avoid flooding KUAL's log) -if pkill -0 reader.lua ; then +if pidof reader.lua > /dev/null 2>&1 ; then logmsg "Sending a SIGTERM to stray KOreader processes . . ." killall -TERM reader.lua fi diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 91539f97a..3983477e7 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -89,7 +89,7 @@ else # if we were called from advboot then we must reboot to go to the menu # NOTE: This is actually achieved by checking if KSM is running: # This might lead to false-positives if you use neither KSM nor advboot to launch KOReader *without nickel running*. - if ! pidof ksmhome.sh > /dev/null 2>&1 ; then + if ! pgrep -f ksmhome.sh > /dev/null 2>&1 ; then reboot fi fi