main.pd loader + different killing method

master
root 7 years ago
parent 4c07482ef5
commit 167256bb98

@ -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

Loading…
Cancel
Save