From 7d5eae2554b5da7925e3fc4632f407cab8f3ee20 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 11 Jul 2024 11:30:35 +0000 Subject: [PATCH] armbian_rootenc_setup.sh: migrate from old authorized_keys setup --- scripts/armbian_rootenc_setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/armbian_rootenc_setup.sh b/scripts/armbian_rootenc_setup.sh index 30a3f24..990db16 100755 --- a/scripts/armbian_rootenc_setup.sh +++ b/scripts/armbian_rootenc_setup.sh @@ -420,6 +420,12 @@ _test_sdcard_mounted() { } get_authorized_keys() { + if [ -f 'authorized_keys' ]; then + rm -rf /tmp/armbian_rootenc_build-authorized_keys_file + mv 'authorized_keys' /tmp/armbian_rootenc_build-authorized_keys_file + mkdir 'authorized_keys' + mv /tmp/armbian_rootenc_build-authorized_keys_file 'authorized_keys' + fi [ -e 'authorized_keys' -a "$USE_LOCAL_AUTHORIZED_KEYS" ] || { mkdir -p 'authorized_keys' rsync "$UNLOCKING_USERHOST:.ssh/id_*.pub" 'authorized_keys' @@ -1084,7 +1090,7 @@ managed=1' [ -e $bu_file ] && /bin/mv $bu_file $file fi _display_file $file - else + elif [ "$USB_GADGET" ]; then warn "$file does not exist, not enabling managed usb0" fi } @@ -1112,7 +1118,7 @@ iface usb0 inet static systemctl unmask network-manager fi _display_file $file - else + elif [ "$USB_GADGET" ]; then warn "$file does not exist, not configuring static usb0" fi }