1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/bash
# An example script for the genmon plugin to mount/umount USB disk
# Change sda1 to your USB disk device
ls -l /dev/sda1 >/dev/null 2>&1
if [ $? == 0 ]
then
grep "/dev/sda1" /etc/mtab >/dev/null 2>&1
if [ $? == 0 ]
then
echo "<img>/usr/local/share/icons/Tango/16x16/actions/gtk-delete.png</img>"
echo "<click>umount /dev/sda1</click>"
echo "<tool>Click to unmount the USB disk</tool>"
else
echo "<img>/usr/local/share/icons/Tango/16x16/devices/gnome-dev-harddisk-usb.png</img>"
echo "<click>mount /dev/sda1</click>"
echo "<tool>Click to mount the USB disk</tool>"
fi
else
echo "<img>/usr/local/share/icons/Tango/16x16/actions/add.png</img>"
echo "<tool>No USB disk detected</tool>"
fi
|