diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-11 23:09:33 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-11 23:20:33 +0200 |
commit | d6ef68b85ab1cc932b98a28b82c392a01d20765d (patch) | |
tree | fb697e528d9f5cb01c94b9b9d243d1ed80e63e75 | |
parent | ed7801ce2b68a821f3e4f16902615a8a6d06b5aa (diff) | |
download | alpine-conf-d6ef68b85ab1cc932b98a28b82c392a01d20765d.zip |
setup-sshd: mock fetching ssh key
and improve error message a bit
-rw-r--r-- | setup-sshd.in | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/setup-sshd.in b/setup-sshd.in index 8ee9931..8987226 100644 --- a/setup-sshd.in +++ b/setup-sshd.in @@ -49,7 +49,7 @@ fi $MOCK apk add --quiet $pkgs -if [ "$sshdchoice" = "openssh" ] && [ -z "authorized_keys" ]; then +if [ "$sshdchoice" = "openssh" ] && [ -z "$authorized_key" ]; then while true; do ask "Allow root ssh login? ('yes', 'no', 'prohibit-password' or KEYURL) [prohibit-password]" prohibit-password case "$resp" in @@ -61,7 +61,7 @@ if [ "$sshdchoice" = "openssh" ] && [ -z "authorized_keys" ]; then break ;; http://*|https://*) - authorized_key="$($MOCK wget -qO- "$resp")" || { echo "Could not fetch key from '$resp'"; continue; } + authorized_key="$($MOCK wget -qO- "$resp")" || { echo "Failed to fetch key from '$resp'"; continue; } break ;; esac @@ -84,7 +84,7 @@ if [ -n "$authorized_key" -a "$authorized_key" != "none" ]; then case "$authorized_key" in http*://*|ftp://) key_url="$authorized_key" - authorized_key="$(wget -qO- "$key_url")" || die "Could not fetch key from '$key_url'" + authorized_key="$($MOCK wget -qO- "$key_url")" || die "Failed to fetch key from '$key_url'" ;; esac mkdir -p ${ROOT}/root/.ssh |