From 167256bb981b7be9566396c78f6fd0b7175a3d20 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Mar 2017 20:27:25 +0100 Subject: [PATCH] main.pd loader + different killing method --- sbin/thewhispererindarkness.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sbin/thewhispererindarkness.sh b/sbin/thewhispererindarkness.sh index 5e5ad5d..98ccab1 100755 --- a/sbin/thewhispererindarkness.sh +++ b/sbin/thewhispererindarkness.sh @@ -4,6 +4,7 @@ FD="/dev/sda" FLOPPY="/media/floppy" MAINPY="${FLOPPY}/main.py" +MAINPYRUN="python ${MAINPY}" MAINPD="${FLOPPY}/main.pd" stdbuf -oL -- udevadm monitor --udev -p ${FD} | while read -r -- STATE _ _ _ _ @@ -18,19 +19,26 @@ do if [ -e "${MAINPY}" ] then echo "main.py found" - $(python ${MAINPY})& + $(${MAINPYRUN})& fi if [ -e "${MAINPD}" ] then echo "main.pd found" + $(pd -rt -nogui ${MAINPD})& fi else echo "floppy out (no fs detected)" - if [ "$(pgrep python)" ] + if [ "$(pgrep -f '^python')" ] then echo "python still running ... killing" pkill -9 python fi + if [ "$(pgrep -f '^pd')" ] + then + echo "pd still running ... killing" + pkill -9 pd + fi + fi fi done