HalfEmptyHero
November 30th, 2009, 04:40 PM
I'm trying to write a bash script to run at startup that will automatically mount a truecrypt volume I have using a keyfile. The plan is to use an SD card to keep a keyfile that I only keep in the computer when I am using it. I am using the following command, which does work how I want it.
truecrypt -t /dev/sda2 /mnt/Private --password="" -k "/media/PORTABLE/.prkyrc" --protect-hidden=no
I don't know much bash, and what I want to do is to have the script check first if /media/PORTABLE is mounted, and if not check if the SD card is present (should be at /dev/mmcblk0) and mount it if it is. Then, check if the truecrypt volume is mounted, and if it isn't then mount it. Obviously if it is already mounted it will do nothing, and if the SD card is not present, do nothing as well.
Anyone want to help me out?
truecrypt -t /dev/sda2 /mnt/Private --password="" -k "/media/PORTABLE/.prkyrc" --protect-hidden=no
I don't know much bash, and what I want to do is to have the script check first if /media/PORTABLE is mounted, and if not check if the SD card is present (should be at /dev/mmcblk0) and mount it if it is. Then, check if the truecrypt volume is mounted, and if it isn't then mount it. Obviously if it is already mounted it will do nothing, and if the SD card is not present, do nothing as well.
Anyone want to help me out?