|
|
@ -4,6 +4,7 @@
|
|
|
|
FD="/dev/sda"
|
|
|
|
FD="/dev/sda"
|
|
|
|
FLOPPY="/media/floppy"
|
|
|
|
FLOPPY="/media/floppy"
|
|
|
|
MAINPY="${FLOPPY}/main.py"
|
|
|
|
MAINPY="${FLOPPY}/main.py"
|
|
|
|
|
|
|
|
MAINPYRUN="python ${MAINPY}"
|
|
|
|
MAINPD="${FLOPPY}/main.pd"
|
|
|
|
MAINPD="${FLOPPY}/main.pd"
|
|
|
|
|
|
|
|
|
|
|
|
stdbuf -oL -- udevadm monitor --udev -p ${FD} | while read -r -- STATE _ _ _ _
|
|
|
|
stdbuf -oL -- udevadm monitor --udev -p ${FD} | while read -r -- STATE _ _ _ _
|
|
|
@ -18,19 +19,26 @@ do
|
|
|
|
if [ -e "${MAINPY}" ]
|
|
|
|
if [ -e "${MAINPY}" ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
echo "main.py found"
|
|
|
|
echo "main.py found"
|
|
|
|
$(python ${MAINPY})&
|
|
|
|
$(${MAINPYRUN})&
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -e "${MAINPD}" ]
|
|
|
|
if [ -e "${MAINPD}" ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
echo "main.pd found"
|
|
|
|
echo "main.pd found"
|
|
|
|
|
|
|
|
$(pd -rt -nogui ${MAINPD})&
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "floppy out (no fs detected)"
|
|
|
|
echo "floppy out (no fs detected)"
|
|
|
|
if [ "$(pgrep python)" ]
|
|
|
|
if [ "$(pgrep -f '^python')" ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
echo "python still running ... killing"
|
|
|
|
echo "python still running ... killing"
|
|
|
|
pkill -9 python
|
|
|
|
pkill -9 python
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(pgrep -f '^pd')" ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "pd still running ... killing"
|
|
|
|
|
|
|
|
pkill -9 pd
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|