feat(zbm): Define Dropbear's SSH pub keys (#6)

This commit is contained in:
hygienic-books 2023-11-03 01:38:28 +01:00
parent 732cc47405
commit 1690518197

View File

@ -809,6 +809,17 @@ function ensure_ip_in_kcl () {
yq -i '.Kernel.CommandLine = "'"${new_kcl}"'"' "${zbm_config}"
}
function set_pub_keys () {
local authorized_keys_file raw_pub_keys
authorized_keys_file="${1:?}"
raw_pub_keys="${2:?}"
:> "${authorized_keys_file}"
while IFS= read -r pub_key_line; do
printf -- '%s\n' "${pub_key_line}" >> "${authorized_keys_file}"
done < <(<<<"${raw_pub_keys}" sed -r -e 's/,,/\n/g')
sed -i '/^$/d' "${authorized_keys_file}"
}
function we_want_ssh () {
#2.10
if [[ "${ARCHZBM_NET_CLIENT_IP}" ]] || \