armbian_rootenc_setup.sh: new authorized_keys_dir variable

This commit is contained in:
The MMGen Project 2026-06-19 13:29:36 +00:00
commit fadc18812b
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -437,11 +437,10 @@ _test_sdcard_mounted() {
}
get_authorized_keys() {
authorized_keys_dir="authorized_keys.d"
[ -e $authorized_keys_dir ] || {
if [ -f 'authorized_keys' ]; then
if [ -f $authorized_keys_file ]; then
mkdir -p $authorized_keys_dir
mv 'authorized_keys' $authorized_keys_dir
mv $authorized_keys_file $authorized_keys_dir
NEW_AUTHORIZED_KEYS='y'
else
_test_unlocking_host_available
@ -1183,9 +1182,9 @@ edit_initramfs_modules() {
copy_authorized_keys() {
local dest="$TARGET_ROOT$dropbear_dir"
mkdir -p $dest
/bin/cat $authorized_keys_dir/* > "$dest/authorized_keys"
chmod 644 "$dest/authorized_keys"
_display_file "$dest/authorized_keys"
/bin/cat $authorized_keys_dir/* > "$dest/$authorized_keys_file"
chmod 644 "$dest/$authorized_keys_file"
_display_file "$dest/$authorized_keys_file"
}
create_fstab() {
@ -1485,6 +1484,9 @@ ARG1=$1
shift
authorized_keys_dir='authorized_keys.d'
authorized_keys_file='authorized_keys'
_set_env_vars $@
if [ "$ARG1" == 'in_target' ]; then