File: monUSB

package info (click to toggle)
xfce4-genmon-plugin 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 932 kB
  • sloc: ansic: 1,273; sh: 314; makefile: 129; perl: 21
file content (24 lines) | stat: -rwxr-xr-x 739 bytes parent folder | download
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