Fix missing newline when adding new authorized ssh keys.

This commit is contained in:
Kevin Baensch 2023-01-06 09:19:59 +01:00
parent f0cbc32c36
commit f77e32f7ee

View file

@ -101,7 +101,7 @@ setup_sqlproxy() {
PUB_KEY="$(cat ${HOME}/.ssh/${KEY_NAME}.pub)" PUB_KEY="$(cat ${HOME}/.ssh/${KEY_NAME}.pub)"
if ! grep -qe "$(printf '%s$' "${PUB_KEY}")" "${PROJECT_PATH}/etc/ssh/.ssh/authorized_keys" if ! grep -qe "$(printf '%s$' "${PUB_KEY}")" "${PROJECT_PATH}/etc/ssh/.ssh/authorized_keys"
then then
printf 'command="/sqlproxy_cli.sh" %s' "${PUB_KEY}" >> "${PROJECT_PATH}/etc/ssh/.ssh/authorized_keys" printf 'command="/sqlproxy_cli.sh" %s\n' "${PUB_KEY}" >> "${PROJECT_PATH}/etc/ssh/.ssh/authorized_keys"
fi fi
printf 'Restarting sql proxy (if running) to fix permissions.\n' printf 'Restarting sql proxy (if running) to fix permissions.\n'