mirror of
https://github.com/fire1ce/UDM-Persistent-SSH-Keys.git
synced 2023-10-10 13:36:54 +02:00
Adjusted script to cater for UDM Pro 2.4.23
Adjusted script to cater for new data locations supporting UDM firmwares 1.x, 2.x and 3.x
This commit is contained in:
parent
46166b2de9
commit
b1687681f8
@ -1,9 +1,27 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
user_authorized_keys_file="/mnt/data/ssh/authorized_keys"
|
# Get DataDir location
|
||||||
|
DATA_DIR="/mnt/data"
|
||||||
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
|
1*)
|
||||||
|
DATA_DIR="/mnt/data"
|
||||||
|
;;
|
||||||
|
2*)
|
||||||
|
DATA_DIR="/data"
|
||||||
|
;;
|
||||||
|
3*)
|
||||||
|
DATA_DIR="/data"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
user_authorized_keys_file="$DATA_DIR/ssh/authorized_keys"
|
||||||
udm_authorized_keys_file="/root/.ssh/authorized_keys"
|
udm_authorized_keys_file="/root/.ssh/authorized_keys"
|
||||||
|
|
||||||
# if /mnt/data/ssh/authorized_keys is missing print error message
|
# if $DATA_DIR/ssh/authorized_keys is missing print error message
|
||||||
if [ ! -f "$user_authorized_keys_file" ]; then
|
if [ ! -f "$user_authorized_keys_file" ]; then
|
||||||
echo "ERROR: $user_authorized_keys_file is missing"
|
echo "ERROR: $user_authorized_keys_file is missing"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user