[X2Go-Commits] [live-build-x2go] 05/35: name change
git-admin at x2go.org
git-admin at x2go.org
Fri Apr 28 11:34:20 CEST 2017
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/fvwm
in repository live-build-x2go.
commit f7c6c16108a9fb8e5cb8550dcc95c3fce49401d9
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Mon Jan 2 10:10:31 2017 +0100
name change
---
.../lib/live/config/2150-getsshpubkeysfromserver | 54 ++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver
new file mode 100755
index 0000000..a40918d
--- /dev/null
+++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+SetSSHKey ()
+{
+
+ # Output startup message
+ #
+ echo -n " setsshkey"
+
+
+ PUBKEYURL=$(cat /proc/cmdline | \
+ tr ' ' '\n' | \
+ awk -F'=' ' /^pubkey=/ { print $2 }')
+
+ if [ -n "$PUBKEYURL" ] ; then
+ cat >/etc/network/if-up.d/getpubkey <<GETPUBKEY
+#!/bin/bash
+export TERM=linux;
+
+while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do
+ sleep 2
+done
+
+# 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
+GETPUBKEY
+
+ chmod 755 /etc/network/if-up.d/getpubkey
+ 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
More information about the x2go-commits
mailing list