#!/bin/bash #If the current USB drive path is /media/usbdisk # Then copy the usbdisk1 file into the default file # Else copy the usbdisk file into the default file # #David Welsh #May 31, 2005 echo " Start SwitchUsbDisk.bash `date -u`" #Set the execution path export PATH=$HOME/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin #get the USB disk mount point read diskpath < "$HOME"/search/diskpath #Switch the USB disk if [ "$diskpath" = '/media/usbdisk' ]; then echo " switching from usbdisk to usbdisk1" cp $HOME/search/usbdisk1 $HOME/search/diskpath else echo " switching from usbdisk1 to usbdisk" cp $HOME/search/usbdisk $HOME/search/diskpath fi echo " Stop SwitchUsbDisk.bash `date -u`"