diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-21 15:09:45 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-21 15:09:45 +0200 |
commit | bc7d08077a10caeecc3b8bcf941f883492b47357 (patch) | |
tree | e4d9a2695cf4bcaa0eb4d5442125a995cc045e7f | |
parent | 1ce63fc40dade90edc812d4632e91d275321968b (diff) | |
download | alpine-conf-bc7d08077a10caeecc3b8bcf941f883492b47357.zip |
setup-user: add magic keywords for fetching ssh keys
Use al, gh, and gl as magic keywords to suggest url for shs key
-rw-r--r-- | setup-user.in | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/setup-user.in b/setup-user.in index 8f4047f..0801525 100644 --- a/setup-user.in +++ b/setup-user.in @@ -76,12 +76,30 @@ while true; do done if [ -n "$interactive" ] && [ -z "$keysopt" ]; then + suggest=none while true; do - ask "Enter ssh key or URL for $username (or 'none')" none + ask "Enter ssh key or URL for $username (or 'none')" $suggest case "$resp" in - none) break;; - https://*|http://*) sshkeys=$(wget -q -O- $resp | grep ^ssh-);; - *) sshkeys="$resp";; + al) + suggest="https://gitlab.alpinelinux.org/$username.keys" + continue + ;; + gl) + suggest="https://gitlab.com/$username.keys" + continue + ;; + gh) + suggest="https://github.com/$username.keys" + continue + ;; + none) + break + ;; + https://*|http://*) + sshkeys=$(wget -q -O- $resp | grep ^ssh-) + ;; + *) sshkeys="$resp" + ;; esac if echo "$sshkeys" | grep -q ^ssh-; then break |