]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix the --auth-key flag in gentoo template
authorErik Mackdanz <erikmack@gmail.com>
Thu, 12 Mar 2015 21:36:18 +0000 (16:36 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 13 Mar 2015 23:20:24 +0000 (19:20 -0400)
Fix a typo in the getopt call,  should be auth-key not auth_key.
Also provide the argument to cat, so the script doesn't hang waiting
on stdin.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-gentoo.in

index bcaca4eb790a577b3a94387136523358882fe808..0a767668669973bd145aef5cf24bc10cbfd0b741 100644 (file)
@@ -641,11 +641,11 @@ container_auth()
     if [[ -r "${auth_key}" ]]; then
         printf " deploying auth_key %s for user %s ...\n" "${auth_key}" "${user}"
         mkdir -p "${rootfs}/${auth_home}/.ssh"
-        cat >> "${rootfs}/${auth_home}/.ssh/authorized_keys"
+        cat "${auth_key}" >> "${rootfs}/${auth_home}/.ssh/authorized_keys"
         chroot "${rootfs}" chown "${user}:" "${auth_home}/.ssh/authorized_keys"
         printf "  => inserted public key in %s/.ssh/authorized_keys\n" "${auth_home}"
         [[ -z "${forced_password}" ]] && unset password
-        store_user_message "${user} has the ssh key you gived us"
+        store_user_message "${user} has the ssh key you gave us"
     fi
 
     if [[ -n "${password}" ]]; then
@@ -782,7 +782,7 @@ user="root"
 password="toor"
 tty=1
 settings="common"
-options=$(getopt -o hp:n:a:FcPv:t:S:u:w:s:m: -l help,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth_key:,user:,autologin,password:,settings:,mirror:,tty: -- "$@")
+options=$(getopt -o hp:n:a:FcPv:t:S:u:w:s:m: -l help,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth-key:,user:,autologin,password:,settings:,mirror:,tty: -- "$@")
 
 eval set -- "$options"