#! /bin/sh
+sudo /etc/init.d/cfsd start || sudo /etc/init.d/cfsd restart || exit 1 # kludge
+grep -q '/mnt/usb ' /proc/mounts || sudo mount /mnt/usb
sudo losetup /dev/loop0 /mnt/usb/cjwatson
-sudo mount -t ext2 /dev/loop0 /mnt/usb/keys
-cattach /mnt/usb/keys/keys cjwatson-keys
+grep -q '/mnt/usb/keys ' /proc/mounts || sudo mount -t ext2 /dev/loop0 /mnt/usb/keys
+[ -d /crypt/cjwatson-keys ] || cattach /mnt/usb/keys/keys cjwatson-keys