|
@@ -11,9 +11,10 @@ lsblk | grep $device
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
if [ $? -eq 0 ]; then
|
|
echo "$(date) Device exists on machine."
|
|
echo "$(date) Device exists on machine."
|
|
- echo "$(date) Mounting device $1 to /mnt/floppy."
|
|
|
|
|
|
+ echo "$(date) Forcing unmount of floppy"
|
|
/usr/bin/systemd-mount --umount /mnt/floppy
|
|
/usr/bin/systemd-mount --umount /mnt/floppy
|
|
echo "$(date) Floppy unmounted"
|
|
echo "$(date) Floppy unmounted"
|
|
|
|
+ echo "$(date) Mounting floppy "
|
|
/usr/bin/systemd-mount $1 /mnt/floppy
|
|
/usr/bin/systemd-mount $1 /mnt/floppy
|
|
echo "$(date) Floppy mounted"
|
|
echo "$(date) Floppy mounted"
|
|
var=$(cat /mnt/floppy/diskplayer.contents)
|
|
var=$(cat /mnt/floppy/diskplayer.contents)
|
|
@@ -22,5 +23,7 @@ if [ $? -eq 0 ]; then
|
|
else
|
|
else
|
|
echo "$(date) Device does not exist on machine."
|
|
echo "$(date) Device does not exist on machine."
|
|
runuser -l pi -c "python3 /home/pi/pythonDiskPlayer/player.py stop"
|
|
runuser -l pi -c "python3 /home/pi/pythonDiskPlayer/player.py stop"
|
|
|
|
+ echo "$(date) Forcing unmount of floppy"
|
|
|
|
+ /usr/bin/systemd-mount --umount /mnt/floppy
|
|
fi
|
|
fi
|
|
echo "$(date) End."
|
|
echo "$(date) End."
|