summaryrefslogtreecommitdiff
path: root/setup-alpine.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-01 12:56:55 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-01 12:56:55 +0200
commit207733ab8d3863b469c0c173714953eedda60bb8 (patch)
tree33823262d219752ea21336211ecf6aa19b8b2683 /setup-alpine.in
parente13c60002f7fda9c7e0f631b0b2837898a23b9b6 (diff)
downloadalpine-conf-207733ab8d3863b469c0c173714953eedda60bb8.zip
setup-alpine: add USERSSHKEY option to answerfile
Add a variable for user's ssh key, USERSSHKEY. We need this because the key is space separated and we want avoid parse USEROPTS with eval to handle quotes. fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10520
Diffstat (limited to 'setup-alpine.in')
-rw-r--r--setup-alpine.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index d393c5d..ad3c430 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -113,7 +113,8 @@ if [ -n "$CREATEANSWERFILE" ]; then
APKREPOSOPTS="-1"
# Create admin user
- USEROPTS="-a -u -g audio,video,netdev -k https://example.com/juser.keys juser"
+ USEROPTS="-a -u -g audio,video,netdev juser"
+ USERSSHKEY="https://example.com/juser.keys"
# Install Openssh
SSHDOPTS=openssh
@@ -231,7 +232,7 @@ if [ "$quick" = 1 ]; then
exit 0
fi
-setup-user ${USEROPTS:--a -g 'audio video netdev'}
+setup-user ${USERSSHKEY+-k "$USERSSHKEY"} ${USEROPTS:--a -g 'audio video netdev'}
setup-sshd ${SSHDOPTS}
if is_xen_dom0; then