Fixed Typo in add ssh keys and added command check (#635)

This commit is contained in:
highTower.SU
2025-01-13 15:08:47 +01:00
committed by GitHub
parent 575541ea5c
commit 6d59419b5f

View File

@ -1,6 +1,8 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
@ -34,8 +36,9 @@ if [ $count_skipped -gt 0 ]; then
echo "${count_skipped} already added keys skipped"
fi
# Convert ssh key to dropbear for shell interaction
echo "Converting SSH private key to dropbear format"
dropbearconvert openssh dropbear ${DATA_DIR}/ssh/id_rsa /root/.ssh/id_dropbear
if command -v dropbearconvert >/dev/null 2>&1; then
# Convert ssh key to dropbear for shell interaction
echo "Converting SSH private key to dropbear format"
dropbearconvert openssh dropbear ${DATA_DIR}/ssh/id_rsa /root/.ssh/id_dropbear
fi
exit 0