Check for backup key file
This commit is contained in:
parent
b5f6a554f3
commit
c1bd5c9691
|
@ -119,9 +119,13 @@ function interactive_gpg_from_usb {
|
||||||
cp -r $USB_MOUNT/letsencrypt/* /etc/letsencrypt
|
cp -r $USB_MOUNT/letsencrypt/* /etc/letsencrypt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $USB_MOUNT/.mastergpgkey && -f $USB_MOUNT/.backupgpgkey ]; then
|
if [ -f $USB_MOUNT/.mastergpgkey ]; then
|
||||||
# Recovering keys from file rather than just copying the gnupg
|
# Recovering keys from file rather than just copying the gnupg
|
||||||
# directory may help to avoid problems during upgrades/reinstalls
|
# directory may help to avoid problems during upgrades/reinstalls
|
||||||
|
if [ ! -f $USB_MOUNT/.backupgpgkey ]; then
|
||||||
|
echo $'No backup key file found on USB drive'
|
||||||
|
exit 725729
|
||||||
|
fi
|
||||||
gpg --homedir=/home/$MY_USERNAME/.gnupg --allow-secret-key-import --import $USB_MOUNT/.mastergpgkey
|
gpg --homedir=/home/$MY_USERNAME/.gnupg --allow-secret-key-import --import $USB_MOUNT/.mastergpgkey
|
||||||
echo "$BACKUP_DUMMY_PASSWORD" | gpg --batch --passphrase-fd 0 --homedir=/home/$MY_USERNAME/.gnupg --allow-secret-key-import --import $USB_MOUNT/.backupgpgkey
|
echo "$BACKUP_DUMMY_PASSWORD" | gpg --batch --passphrase-fd 0 --homedir=/home/$MY_USERNAME/.gnupg --allow-secret-key-import --import $USB_MOUNT/.backupgpgkey
|
||||||
if [ -d /home/$MY_USERNAME/.gnupg ]; then
|
if [ -d /home/$MY_USERNAME/.gnupg ]; then
|
||||||
|
|
Loading…
Reference in New Issue