Copy ssh keys from USB drive if they exist

This commit is contained in:
Bob Mottram 2015-06-29 23:12:05 +01:00
parent 261c4ee9b4
commit 04d8c4b542
1 changed files with 5 additions and 1 deletions

View File

@ -241,7 +241,7 @@ function interactive_gpg {
dialog --title "Encryption keys" \
--backtitle "Freedombone Configuration" \
--defaultno \
--yesno "\nDo you have existing GPG/PGP keys that you wish to install?" 7 60
--yesno "\nDo you have existing GPG/PGP/ssh keys that you wish to install?" 7 60
sel=$?
case $sel in
1) return;;
@ -300,6 +300,10 @@ function interactive_gpg {
cp -r $GPG_USB_MOUNT/.gnupg /home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')
if [ -d $GPG_USB_MOUNT/.ssh ]; then
cp $GPG_USB_MOUNT/.ssh/* /home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')/.ssh
fi
umount $GPG_USB_MOUNT
rm -rf $GPG_USB_MOUNT
}