No need to read usb drive
This commit is contained in:
parent
408eb08222
commit
d321d9f18f
|
@ -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
|
||||
;;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue