This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/stretch
in repository live-build-x2go.

commit dcf7effa4415016b99e79d664fe739683dfd3c8f
Author: Stefan Baur (BAUR-ITCS) <[email protected]>
Date:   Fri Dec 16 02:31:58 2016 +0100

    added authorized_keys download support
---
 .../includes.chroot/lib/live/config/2150-setsshkey |   44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/config/includes.chroot/lib/live/config/2150-setsshkey 
b/config/includes.chroot/lib/live/config/2150-setsshkey
new file mode 100755
index 0000000..45572f7
--- /dev/null
+++ b/config/includes.chroot/lib/live/config/2150-setsshkey
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+SetSSHKey ()
+{
+
+# Output startup message
+#
+echo -n " setsshkey"
+
+
+PUBKEYURL=$(cat /proc/cmdline | \
+           tr ' ' '\n' | \
+           awk -F'=' ' /^pubkey=/ { print $2 }')
+
+if [ -n "$PUBKEYURL" ] ; then
+
+       # Set Keyfile
+       #
+       mkdir -p /root/.ssh
+       chmod 600 /root/.ssh
+       touch /root/.ssh/authorized_keys
+       chmod 600 /root/.ssh/authorized_keys
+
+       if echo "$PUBKEY" | grep -q "^tftp://"; ; then
+               PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 
's#^tftp://\([^/]*\)/.*$#\1#' )
+               PUBKEYPATH=$(echo "$PUBKEYURL" | sed 
's#^tftp://[^/]*/\(.*\)$#\1#' )
+               if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then
+                       while ! atftp $PUBKEYSERVER -g -r $PUBKEYPATH -l 
/root/.ssh/authorized_keys ; do
+                               echo "Waiting for SSH Public Key ..."
+                               sleep 5
+                       done
+               fi
+       else
+               while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do
+                       echo "Waiting for SSH Public Key ..."
+                       sleep 5
+               done
+       fi
+fi
+
+}
+
+SetSSHKey
+

--
Alioth's 
/srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on 
/srv/git/code.x2go.org/live-build-x2go.git
_______________________________________________
x2go-commits mailing list
[email protected]
http://lists.x2go.org/listinfo/x2go-commits

Reply via email to