Skip to content

Instantly share code, notes, and snippets.

@lionelyoung
Created May 22, 2010 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionelyoung/409741 to your computer and use it in GitHub Desktop.
Save lionelyoung/409741 to your computer and use it in GitHub Desktop.
#!/bin/bash
#put name of device here
MYMOUNTDIR=/mnt/location/here
PASSFILE=/home/yourname/passfile.kdb
DEVICEDIR=/dev/sdc1
if [ -b /dev/sdc ]; then
echo Mounting /dev/sdc
exo-mount -d $DEVICEDIR || exit 1
fi
if [ -d $MYMOUNTDIR ]; then
echo Rsyncing passwords to $MYMOUNTDIR
rsync --verbose $PASSFILE $MYMOUNTDIR || exit 1
else
echo $MYMOUNTDIR does not exist, this is not your USB drive
fi
if [ -b /dev/sdc ]; then
echo Unmounting $DEVICEDIR
exo-unmount -d $DEVICEDIR || exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment