From d321d9f18f0bafb7bb14e7cf1bbab8e64b6251f8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 23 Jun 2017 22:14:24 +0100 Subject: [PATCH] No need to read usb drive --- src/freedombone-recoverkey | 19 ++----------------- src/freedombone-utils-keys | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/freedombone-recoverkey b/src/freedombone-recoverkey index 87026d3a..ebac639d 100755 --- a/src/freedombone-recoverkey +++ b/src/freedombone-recoverkey @@ -42,20 +42,13 @@ do source $f done -read_config_param USB_DRIVE - FRIENDS_SERVERS_LIST= MY_USERNAME= -if [ $USB_DRIVE ]; then - GPG_USB_DRIVE=$USB_DRIVE -else - GPG_USB_DRIVE='/dev/sdb1' -fi function show_help { echo '' - echo $"${PROJECT_NAME}-recoverkey -u [username] -d [drive]" - echo $' -l [friends servers list filename]' + echo $"${PROJECT_NAME}-recoverkey -u [username]" + echo $' -l [friends servers list filename]' echo '' exit 0 } @@ -78,14 +71,6 @@ do shift FRIENDS_SERVERS_LIST="$1" ;; - -d|--drive) - shift - if [[ "${1}" != '/dev/'* ]]; then - GPG_USB_DRIVE=/dev/${1}1 - else - GPG_USB_DRIVE=${1} - fi - ;; *) # unknown option ;; diff --git a/src/freedombone-utils-keys b/src/freedombone-utils-keys index 6793a7bb..c021e8f8 100755 --- a/src/freedombone-utils-keys +++ b/src/freedombone-utils-keys @@ -50,7 +50,7 @@ function reconstruct_key { dialog --title $"Recover Encryption Keys" --msgbox $'Unable to reconstruct the key' 6 70 fi - su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME + gpg --homedir=/home/$MY_USERNAME/.gnupg --allow-secret-key-import --import $KEYS_FILE if [ ! "$?" = "0" ]; then echo $'Unable to import gpg key' shred -zu $KEYS_FILE