No need to read usb drive

This commit is contained in:
Bob Mottram 2017-06-23 22:14:24 +01:00
parent 408eb08222
commit d321d9f18f
2 changed files with 3 additions and 18 deletions

View File

@ -42,20 +42,13 @@ do
source $f source $f
done done
read_config_param USB_DRIVE
FRIENDS_SERVERS_LIST= FRIENDS_SERVERS_LIST=
MY_USERNAME= MY_USERNAME=
if [ $USB_DRIVE ]; then
GPG_USB_DRIVE=$USB_DRIVE
else
GPG_USB_DRIVE='/dev/sdb1'
fi
function show_help { function show_help {
echo '' echo ''
echo $"${PROJECT_NAME}-recoverkey -u [username] -d [drive]" echo $"${PROJECT_NAME}-recoverkey -u [username]"
echo $' -l [friends servers list filename]' echo $' -l [friends servers list filename]'
echo '' echo ''
exit 0 exit 0
} }
@ -78,14 +71,6 @@ do
shift shift
FRIENDS_SERVERS_LIST="$1" 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 # unknown option
;; ;;

View File

@ -50,7 +50,7 @@ function reconstruct_key {
dialog --title $"Recover Encryption Keys" --msgbox $'Unable to reconstruct the key' 6 70 dialog --title $"Recover Encryption Keys" --msgbox $'Unable to reconstruct the key' 6 70
fi 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 if [ ! "$?" = "0" ]; then
echo $'Unable to import gpg key' echo $'Unable to import gpg key'
shred -zu $KEYS_FILE shred -zu $KEYS_FILE