mirror of
https://github.com/fire1ce/UDM-Persistent-SSH-Keys.git
synced 2023-10-10 11:36:54 +00:00
ensure paths exists before writing keys
Ensure the target path exists before writing the keys so there's no errors for the user. Dropped a temp variable as well.
This commit is contained in:
parent
05d9413601
commit
7d6d086ff3
@ -28,9 +28,9 @@ if [ ! -f "$user_authorized_keys_file" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Reads the user file line by line and adds the key to the authorized_keys file
|
# Reads the user file line by line and adds the key to the authorized_keys file
|
||||||
file=$user_authorized_keys_file
|
mkdir -p "$(dirname ${udm_authorized_keys_file})"
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
while IFS= read -r line || [ -n "$line" ]; do
|
||||||
echo $line >>$udm_authorized_keys_file
|
echo $line >>$udm_authorized_keys_file
|
||||||
done <"$file"
|
done <"$user_authorized_keys_file"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user