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