Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
alpine-conf
Commits
bc7d0807
Commit
bc7d0807
authored
May 21, 2022
by
Natanael Copa
Browse files
setup-user: add magic keywords for fetching ssh keys
Use al, gh, and gl as magic keywords to suggest url for shs key
parent
1ce63fc4
Pipeline
#123040
passed with stage
in 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
setup-user.in
View file @
bc7d0807
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment