diff --git a/99-ssh-keys.sh b/99-ssh-keys.sh index ec7bb01..9fcd682 100755 --- a/99-ssh-keys.sh +++ b/99-ssh-keys.sh @@ -3,20 +3,20 @@ # 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 +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" @@ -30,7 +30,7 @@ fi # Reads the user file line by line and adds the key to the authorized_keys file file=$user_authorized_keys_file while IFS= read -r line || [ -n "$line" ]; do - echo $line >>$udm_authorized_keys_file + echo $line >$udm_authorized_keys_file done <"$file" exit 0