ft@17: #!/bin/sh ft@17: ft@17: DEVICE="$1" ft@17: ft@17: # This script makes sure that the stick is unmounted and unused ft@17: # Run this Script before the init process ft@17: ft@17: # make sure to have "/dev/sdb" (not "/dev/sdb1") ft@17: #DEVICE="${DEVICE:0:8}" the bash way does not work in dash -.- ft@17: DEVICE="$(echo "$DEVICE" | awk '{print substr($1,0,9)}')" ft@17: ft@17: # make sure the device is not mounted ft@26: chattr -i "/tmp/usbmount" ft@26: umount /tmp/usbmount/* ft@17: sleep 1 ft@26: rmdir /tmp/usbmount/* ft@21: umount /media/usb* ft@17: ft@17: # search for already encrypted volumes ft@17: device=$(encryptionprovider.py -g) ft@17: ft@21: if [ "$?" = "0" ] ft@17: then ft@17: encryptionprovider.py -u $device ft@17: fi