mirror of
https://github.com/unifi-utilities/unifios-utilities.git
synced 2025-07-26 05:14:43 +00:00
Fixed Typo in add ssh keys and added command check (#635)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user