[X2Go-Commits] [live-build-x2go] 06/38: x2go-getsessions

git-admin at x2go.org git-admin at x2go.org
Fri Apr 28 11:56:47 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 b3203c30db440f8d0263733dbbd25ff8e980c49d
Author: Stefan Baur <kontakt at baur-itcs.de>
Date:   Mon Jun 20 16:51:30 2016 +0200

    x2go-getsessions
---
 .../lib/live/config/2600-x2go-getsessions          | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions
new file mode 100755
index 0000000..7b15e7d
--- /dev/null
+++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+X2GoGetSessions ()
+{
+# Output startup message
+#
+echo -n " x2go-getsessions"
+
+
+        SESSIONSURL=$(cat /proc/cmdline | \
+                       tr ' ' '\n' | \
+                       awk -F'=' ' /^sessionsurl=/ { print $2 }')
+        if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then 
+        cat >/etc/network/if-up.d/getsessions <<GETSESS
+#!/bin/bash
+export TERM=linux;
+SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new
+
+while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do
+        sleep 2
+done
+if echo "$SESSIONSURL" | grep -q "^tftp://" ; then
+        SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' )
+        SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' )
+        if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then
+                while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do
+                        echo "Waiting for session config data ..."
+                        sleep 5
+                done
+        fi
+else
+        while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do
+                echo "Waiting for session config data ..."
+                sleep 5 
+        done
+fi
+
+if [ -s $SESSIONSDESTINATION ] ; then
+        mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions
+fi
+
+GETSESS
+                chmod 755 /etc/network/if-up.d/getsessions
+        fi
+}
+
+X2GoGetSessions

--
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