From 9f8c321a4362216825e1714a032155b78ae3c618 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Thu, 10 Feb 2011 14:59:20 +0100 Subject: [PATCH] some more fixes for the guided generation --- src/tomb | 13 +++++++++++-- src/tomb-open | 27 +++++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/tomb b/src/tomb index 6c3bbcf..c591ef0 100755 --- a/src/tomb +++ b/src/tomb @@ -453,7 +453,7 @@ create_tomb() { notice "Your tomb is ready on ${FILE} and secured with key ${FILE}.gpg" act "Would you like to save the key on an external usb device?" act "This is recommended for safety:" - act "always keep the key in a different place than the door!" + act "Always keep the key in a different place than the door!" act "If you answer yes, you'll need a USB KEY now: (y/n)" tomb-notify "Tomb has forged a key." "Would you like to save it on USB?" echo -n " > " @@ -468,11 +468,20 @@ create_tomb() { chmod -R go-rwx ${usbkey_mount}/.tomb umount ${usbkey_mount} unset ${usbkey_mount} + notice "Key ${FILE}.gpg succesfully saved on your USB" + act "now we proceed opening your new tomb" + KEY=${FILE}.gpg + CMD2=${FILE} + CMD3=/media/${FILE} + mount_tomb ${FILE} ${WIPE[@]} ${FILE}.gpg fi + else # kept besides (deprecated behaviour) + act "now we proceed opening your new tomb" + KEY=${FILE}.gpg + mount_tomb ${FILE} fi - tomb mount $FILE } diff --git a/src/tomb-open b/src/tomb-open index 5d292a1..f6e2c87 100755 --- a/src/tomb-open +++ b/src/tomb-open @@ -33,7 +33,6 @@ try() { - # got an argument if [ $1 ]; then # is it a tomb? @@ -102,11 +101,7 @@ Create a new Tomb have your USB key and your password. If you choose to proceed now, we'll guide you through the creation - of a new Tomb. You will need the super-user (sudo) password for the - computer you are using, as well time available: depending how big - your tomb will be, make sure you are not running low on batteries, - considering 1GB takes little little less than an hour to be digged. - + of a new Tomb. If you will, I'll be your Crypto Undertaker. Do you want to proceed, Master? (y/n) EOF @@ -127,8 +122,17 @@ read size echo " You have commanded the creation of this Tomb:" echo " $filename ( $size MBytes )"; echo -echo " Please confirm if you want to proceed now," -echo " digging will take quite some time! (y/n)" +cat < " read -q if [ $? != 0 ]; then @@ -146,7 +150,14 @@ tomb create ${filename}.tomb $size if [ $? != 0 ]; then echo "An error occurred creating tomb, operation aborted." exit 1 +else + tombname="${filename%%.*}" + tombmap=`mount -l | awk "/\[${tombname}\]$/"' { print $1 } '` + tombmount=`mount -l | awk "/\[${tombname}\]$/"' { print $3 } '` + tomb-status $tombmap $tombname $tombmount &! fi + + # if ! [ -r /usr/share/applications/tomb.desktop ]; then # echo " Well done!" # echo " Now the last thing to do is to install Tomb on your desktop:"