armbian_rootenc_setup.sh: new authorized_keys_dir variable
This commit is contained in:
parent
314b16f922
commit
fadc18812b
1 changed files with 8 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue