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