tmore fixes to the usbkey detection - tomb - the crypto undertaker
 (HTM) git clone git://parazyd.org/tomb.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 49e6d09eae55835a90e92ac565a636a3bc981405
 (DIR) parent b669a11ff410f2dc9458339939e46642f196c58f
 (HTM) Author: Jaromil <jaromil@dyne.org>
       Date:   Tue, 11 Jan 2011 14:55:31 +0100
       
       more fixes to the usbkey detection
       
       Diffstat:
         M src/tomb                            |      20 ++++++++++----------
       
       1 file changed, 10 insertions(+), 10 deletions(-)
       ---
 (DIR) diff --git a/src/tomb b/src/tomb
       t@@ -50,8 +50,8 @@ fi
        # usb auto detect
        # tested on ubuntu 10.04 - please test and patch on other systems if you can
        ask_usbkey() {
       -    echo "looking for key $1 on usb"
       -    echo -n "please insert your usb key "
       +    notice "looking for key $1 on usb"
       +    echo -n " .  please insert your usb key "
        
            plugged=false
            while [ "$plugged" != "true" ]; do
       t@@ -62,7 +62,7 @@ ask_usbkey() {
            done
        
            echo
       -    echo -n "usb key inserted, attaching "
       +    echo -n " .  usb key inserted, opening "
            
            attached=false
            while [ "$attached" != "true" ]; do
       t@@ -75,8 +75,7 @@ ask_usbkey() {
            # get the first partition
            usbpart=`dmesg |tail -n 8 | grep '  sd.:' |cut -d: -f2`
            usbpart=`expr substr $usbpart 1 4`
       -    echo
       -    echo -n "usb key attached, mounting $usbpart "
       +
            # what that it is mounted
            mounted=false
            while [ "$mounted" != "true" ]; do
       t@@ -89,8 +88,8 @@ ask_usbkey() {
            # check where it is mounted
            usbmount=`cat /proc/mounts | awk -v p=$usbpart '{ if( $1 == "/dev/" p) print $2 }'`
            echo
       -    echo "usb key mounted on $usbmount"
       -    export usbkey_mount
       +    act "usb key mounted on $usbmount"
       +    export usbkey_mount=$usbmount
            return 0
        }
        
       t@@ -127,7 +126,7 @@ ask_password() {
        ###
        
        notice "Tomb  -  simple commandline tool for encrypted storage"
       -act "version $VERSION ($DATE) by Denis J. Roio <jaromil@dyne.org>"
       +act "version $VERSION ($DATE) by Jaromil @ dyne.org"
        act ""
        func "invoked with args \"$*\" "
        func "running on `date`"
       t@@ -262,7 +261,7 @@ create_tomb() {
            else
                mkdir -p ${usbkey_mount}/.tomb
                cp -v ${FILE}.gpg ${usbkey_mount}/.tomb/
       -        chown -R go-rwx ${usbkey_mount}/.tomb
       +        chmod -R go-rwx ${usbkey_mount}/.tomb
                rm -rf ${FILE}.gpg
            fi
        
       t@@ -328,7 +327,8 @@ mount_tomb() {
                ask_usbkey
                # returns usbkey_mount, now check if the key is there
                if [ -r ${usbkey_mount}/.tomb/${enc_key} ]; then
       -            notice "key found on ${usbkey_mount}/.tomb/${enc_key}"
       +            enc_key=${usbkey_mount}/.tomb/${enc_key}
       +            notice "key found on ${enc_key}"
                else
                    error "key is missing."
                    exit 1