Improving loading keys from usb
This commit is contained in:
parent
62be11f32c
commit
317a04ab5e
|
@ -312,7 +312,9 @@ function interactive_gpg_from_usb {
|
||||||
dialog --title "Encryption keys" \
|
dialog --title "Encryption keys" \
|
||||||
--msgbox 'Plug in a USB drive containing a copy of your full key or key fragment' 6 70
|
--msgbox 'Plug in a USB drive containing a copy of your full key or key fragment' 6 70
|
||||||
|
|
||||||
|
HOME_DIR=/home/$MY_USERNAME
|
||||||
GPG_LOADING="yes"
|
GPG_LOADING="yes"
|
||||||
|
SSH_IMPORTED="no"
|
||||||
GPG_CTR=0
|
GPG_CTR=0
|
||||||
while [[ $GPG_LOADING == "yes" ]]
|
while [[ $GPG_LOADING == "yes" ]]
|
||||||
do
|
do
|
||||||
|
@ -388,14 +390,30 @@ function interactive_gpg_from_usb {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $GPG_USB_MOUNT/.gnupg ]; then
|
if [ -d $GPG_USB_MOUNT/.gnupg ]; then
|
||||||
cp -r $GPG_USB_MOUNT/.gnupg /home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')
|
if [ ! -d $HOME_DIR/.gnupg ]; then
|
||||||
|
mkdir $HOME_DIR/.gnupg
|
||||||
|
fi
|
||||||
|
cp -r $GPG_USB_MOUNT/.gnupg/* $HOME_DIR/.gnupg
|
||||||
GPG_LOADING="no"
|
GPG_LOADING="no"
|
||||||
|
dialog --title "Encryption keys" \
|
||||||
|
--msgbox "GPG Keyring loaded to $HOME_DIR" 6 70
|
||||||
else
|
else
|
||||||
cp -r $GPG_USB_MOUNT/.gnupg_fragments /home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')
|
if [ ! -d $HOME_DIR/.gnupg_fragments ]; then
|
||||||
|
mkdir $HOME_DIR/.gnupg_fragments
|
||||||
|
fi
|
||||||
|
cp -r $GPG_USB_MOUNT/.gnupg_fragments/* $HOME_DIR/.gnupg_fragments
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $GPG_USB_MOUNT/.ssh ]; then
|
if [[ $SSH_IMPORTED == "no" ]]; then
|
||||||
cp $GPG_USB_MOUNT/.ssh/* /home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')/.ssh
|
if [ -d $GPG_USB_MOUNT/.ssh ]; then
|
||||||
|
if [ ! -d $HOME_DIR/.ssh ]; then
|
||||||
|
mkdir $HOME_DIR/.ssh
|
||||||
|
fi
|
||||||
|
cp $GPG_USB_MOUNT/.ssh/* $HOME_DIR/.ssh
|
||||||
|
dialog --title "Encryption keys" \
|
||||||
|
--msgbox "ssh keys imported" 6 70
|
||||||
|
SSH_IMPORTED="yes"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
umount -f $GPG_USB_MOUNT
|
umount -f $GPG_USB_MOUNT
|
||||||
|
|
Loading…
Reference in New Issue