#!/bin/sh
#
# RJP 24.6.2025 USB unmount script
# Packages sudo, xterm and yad must be installed
#
#
mount > /tmp/mount.txt
yad --center --width=700 --height=200 --text-align=center --title="MOUNTED DRIVES" --text="INFO: $(cat /tmp/mount.txt)"
yad --text="Would like to unmount USB?" --title="QUESTION"
if [ $? = 0 ];
then
/bin/sh -c "xterm -e 'sudo umount /media/da0*'&& yad --center --borders=5 --width=400 --text-align=center --button=ok:1 --title='USB should be unmounted' --buttons-layout=center"
else exit 0
fi
sleep 1
rm /tmp/mount.txt
