[X2Go-Commits] [live-build-x2go] 83/108: removed "dropper" files from /lib/live/config and placed the actual files directly in /etc/network/if-up.d/
git-admin at x2go.org
git-admin at x2go.org
Wed Mar 20 22:13:22 CET 2019
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.
commit b82648e357db470000243d0a79d15c229adaab5c
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Sat Jan 19 00:34:48 2019 +0000
removed "dropper" files from /lib/live/config and placed the actual files directly in /etc/network/if-up.d/
---
.../etc/network/if-up.d/0050-settime | 49 ++++++++++++++++
.../etc/network/if-up.d/0100-show-sysconf | 52 +++++++++++++++++
.../network/if-up.d/0200-getsshpubkeysfromserver | 48 +++++++++++++++
.../etc/network/if-up.d/0300-getxorgconf | 46 +++++++++++++++
.../etc/network/if-up.d/0400-getsessions | 49 ++++++++++++++++
.../etc/network/if-up.d/0410-getbranding | 46 +++++++++++++++
.../includes.chroot/etc/network/if-up.d/0420-getbg | 46 +++++++++++++++
.../etc/network/if-up.d/0430-getxroot | 46 +++++++++++++++
.../includes.chroot/lib/live/config/2000-settime | 66 ---------------------
.../lib/live/config/2100-show-sysconf | 68 ----------------------
.../lib/live/config/2250-getsshpubkeysfromserver | 67 ---------------------
.../lib/live/config/2300-xserver-xorg-getxorgconf | 59 -------------------
.../lib/live/config/2700-x2go-getsessions | 62 --------------------
.../lib/live/config/2710-x2go-getbranding | 61 -------------------
.../lib/live/config/2720-x2go-getbg | 61 -------------------
.../lib/live/config/2730-x2go-getxbackground | 61 -------------------
16 files changed, 382 insertions(+), 505 deletions(-)
diff --git a/config/includes.chroot/etc/network/if-up.d/0050-settime b/config/includes.chroot/etc/network/if-up.d/0050-settime
new file mode 100755
index 0000000..eead814
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0050-settime
@@ -0,0 +1,49 @@
+#!/bin/bash
+export TERM=linux;
+
+if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+fi
+
+NTPSERVERS=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \
+ awk -F'=' ' /^ntp=/ { print $2 }' | \
+ tr -dc 'a-zA-Z0-9.\- ' | \
+ tr '[:upper:]' '[:lower:]' )
+
+if [ "$NTPSERVERS" = "false" ] || [ "$NTPSERVERS" = "off" ] || [ "$NTPSERVERS" = "0" ] ; then
+ NTPCOMMAND="false"
+elif [ -n "$NTPSERVERS" ] ; then
+ echo -en "\n$(date +'%F | %T | ')'$0': Using ntp server(s) '$NTPSERVERS'. First working one in list will be used." | tee -a /dev/tty8
+ NTPCOMMAND="ntpdate -s -b $NTPSERVERS"
+else
+ echo -en "\n$(date +'%F | %T | ')'$0': Using Debian's default ntp servers." | tee -a /dev/tty8
+ NTPCOMMAND="ntpdate-debian -s -b"
+fi
+
+
+(
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+ while [ -f /var/lock/ntpdate ] ; do
+ echo -en "\n'$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8
+ sleep 2
+ done
+ echo -en "\n$(date +'%F | %T | ')'$0': Interface '$IFACE' is up - attempting to set time via ntp in 20 seconds ..." | tee -a /dev/tty8
+
+ sleep 20 # make sure IP, Route, DNS are all up
+
+ if [ "$NTPCOMMAND" = "false" ] ; then
+ echo -en "\n$(date +'%F | %T | ')'$0' - NTP disabled via boot parameter. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8
+ elif $NTPCOMMAND && hwclock --systohc ; then
+ echo -en "\n$(date +'%F | %T | ')'$0' - time has been set." | tee -a /dev/tty8
+ else
+ echo -en "\n$(date +'%F | %T | ')'$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8
+ fi
+) &
diff --git a/config/includes.chroot/etc/network/if-up.d/0100-show-sysconf b/config/includes.chroot/etc/network/if-up.d/0100-show-sysconf
new file mode 100755
index 0000000..14ac8a4
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0100-show-sysconf
@@ -0,0 +1,52 @@
+#!/bin/bash
+export TERM=linux;
+
+# Make sure no language-specific stuff interferes with our matching
+# grep: highlight everything that matches "inet" to the end of its line
+# and also (-E, |$) show every line that has an end => Everything else
+
+if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+fi
+
+(
+ if grep -q findiso /proc/cmdline ; then
+ BOOTEDENV=$(basename $(dirname $(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F'=' ' $1 == "findiso" { print $2 }')) | tr -dc 'a-zA-Z0-9. _\-')
+ fi
+ for TIMESTAMPFILE in /lib/live/mount/rootfs/*/lib; do
+ TIMESTAMP=$(stat -c %Y $TIMESTAMPFILE)
+ HUMANTIMESTAMP=$(date --date="@$TIMESTAMP")
+ done
+
+ # clear old entries
+ sed -i '/^- /d' /etc/issue
+ # delete motd call from pam login, so we don't get the same greeting twice when logging in locally
+ sed -i '/^session optional pam_motd.so/d' /etc/pam.d/login
+
+
+ ## enable banner in sshd config if it was disabled
+ #sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config
+
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ IPMSG=$(LANG=C \
+ /sbin/ip a | \
+ /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \
+ GREP_COLOR="1;32" \
+ /bin/grep -P --color=always "link/ether .*? |$" )
+
+ IPMSG=$( sed 's/^/- /' <<< "$IPMSG" )
+ echo "$IPMSG" | tee -a /etc/motd >> /etc/issue
+ [ -n "$BOOTEDENV" ] && echo "- Booted Environment: $BOOTEDENV" | tee -a /etc/motd >> /etc/issue
+ [ -n "$TIMESTAMP" ] && echo "- Build Version: $TIMESTAMP ($HUMANTIMESTAMP)" | tee -a /etc/motd >> /etc/issue
+
+ # make sure all unused VTs show the new /etc/issue
+ ps -C getty --no-header | awk '{ print $1 }' | xargs -n 1 kill -1
+) &
diff --git a/config/includes.chroot/etc/network/if-up.d/0200-getsshpubkeysfromserver b/config/includes.chroot/etc/network/if-up.d/0200-getsshpubkeysfromserver
new file mode 100755
index 0000000..89ff745
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0200-getsshpubkeysfromserver
@@ -0,0 +1,48 @@
+#!/bin/bash
+export TERM=linux;
+PUBKEYURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^pubkey=/ { print $2 }' |\
+ tr -dc 'a-zA-Z0-9.:/?%_\-')
+
+if [ -n "$PUBKEYURL" ] ; then
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ # Set Keyfile
+ #
+ mkdir -p /root/.ssh
+ chmod 700 /root/.ssh
+ touch /root/.ssh/authorized_keys
+ chmod 600 /root/.ssh/authorized_keys
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting SSH public keyfile download ..." | tee -a /dev/tty8
+ if echo "$PUBKEYURL" | 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 -en "\n$(date +'%F | %T | ')'$0': still waiting for download (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O - "$PUBKEYURL" >/root/.ssh/authorized_keys ; do
+ echo -en "\n$(date +'%F | %T | ')'$0': still waiting for download (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ echo -en "\n$(date +'%F | %T | ')'$0': SSH public keyfile download complete." | tee -a /dev/tty8
+ ) &
+fi
diff --git a/config/includes.chroot/etc/network/if-up.d/0300-getxorgconf b/config/includes.chroot/etc/network/if-up.d/0300-getxorgconf
new file mode 100755
index 0000000..80e376f
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0300-getxorgconf
@@ -0,0 +1,46 @@
+#!/bin/bash
+export TERM=linux;
+XORGCONFURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^xorgconfurl=/ { print $2 }' | \
+ tr -dc 'a-zA-Z0-9.:/?%_\-')
+if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then
+ XORGCONFDESTINATION=/etc/X11/xorg.conf.new
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting xorg.conf download ..." | tee -a /dev/tty8
+ if echo "$XORGCONFURL" | grep -q "^tftp://" ; then
+ XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
+ XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
+ if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then
+ while ! atftp "$XORGCONFSERVER" -g -r "$XORGCONFPATH" -l $XORGCONFDESTINATION ; do
+ echo -en "\n$(date +'%F | %T | ')'$0': still waiting for xorg.conf download (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O $XORGCONFDESTINATION "$XORGCONFURL" ; do
+ echo -en "\n$(date +'%F | %T | ')'$0': still waiting for xorg.conf download (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+
+ echo -en "\n$(date +'%F | %T | ')'$0': xorg.conf download complete." | tee -a /dev/tty8
+
+ if [ -s $XORGCONFDESTINATION ] ; then
+ mv $XORGCONFDESTINATION /etc/X11/xorg.conf
+ fi
+ ) &
+fi
diff --git a/config/includes.chroot/etc/network/if-up.d/0400-getsessions b/config/includes.chroot/etc/network/if-up.d/0400-getsessions
new file mode 100755
index 0000000..d28face
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0400-getsessions
@@ -0,0 +1,49 @@
+#!/bin/bash
+export TERM=linux;
+
+SESSIONSURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^sessionsurl=/ { print $2 }' | \
+ tr -dc 'a-zA-Z0-9.:/?%_\-')
+if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then
+ # only mv this file if SESSIONSURL was set. If not, leave it in place - as
+ # it might have been customized at image creation time
+ mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old
+ SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting session config data download ..." | tee -a /dev/tty8
+ 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 -en "\n$(date +'%F | %T | ')still waiting for session config data (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O $SESSIONSDESTINATION "$SESSIONSURL" ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for session config data (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+
+ echo -en "\n$(date +'%F | %T | ')'$0': session config data download complete." | tee -a /dev/tty8
+ if [ -s $SESSIONSDESTINATION ] ; then
+ mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions
+ fi
+ ) &
+fi
diff --git a/config/includes.chroot/etc/network/if-up.d/0410-getbranding b/config/includes.chroot/etc/network/if-up.d/0410-getbranding
new file mode 100755
index 0000000..97e3ca1
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0410-getbranding
@@ -0,0 +1,46 @@
+#!/bin/bash
+export TERM=linux;
+BRANDINGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^branding=/ { print $2 }' | \
+ tr -dc 'a-zA-Z0-9.:/?%_\-')
+BRANDINGDESTINATION=/etc/x2go/branding.svg
+
+if [ -n "$BRANDINGURL" ] ; then
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting branding SVG download ..." | tee -a /dev/tty8
+ if echo "$BRANDINGURL" | grep -q "^tftp://" ; then
+ BRANDINGSERVER=$(echo "$BRANDINGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' )
+ BRANDINGPATH=$(echo "$BRANDINGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' )
+ if [ -n "$BRANDINGSERVER" ] && [ -n "$BRANDINGPATH" ] ; then
+ while ! atftp "$BRANDINGSERVER" -g -r "$BRANDINGPATH" -l ${BRANDINGDESTINATION}.tmp ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for branding SVG download (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O ${BRANDINGDESTINATION}.tmp "$BRANDINGURL" ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for branding SVG download (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+
+ echo -en "\n$(date +'%F | %T | ')'$0': branding SVG download complete." | tee -a /dev/tty8
+ if [ -s ${BRANDINGDESTINATION}.tmp ] ; then
+ mv ${BRANDINGDESTINATION}.tmp $BRANDINGDESTINATION
+ fi
+ ) &
+fi
diff --git a/config/includes.chroot/etc/network/if-up.d/0420-getbg b/config/includes.chroot/etc/network/if-up.d/0420-getbg
new file mode 100755
index 0000000..323c091
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0420-getbg
@@ -0,0 +1,46 @@
+#!/bin/bash
+export TERM=linux;
+BGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^bg=/ { print $2 }' | \
+ tr -dc 'a-zA-Z0-9.:/?%_\-')
+BGDESTINATION=/etc/x2go/bg.svg
+
+if [ -n "$BGURL" ] ; then
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting background SVG download ..." | tee -a /dev/tty8
+ if echo "$BGURL" | grep -q "^tftp://" ; then
+ BGSERVER=$(echo "$BGURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
+ BGPATH=$(echo "$BGURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
+ if [ -n "$BGSERVER" ] && [ -n "$BGPATH" ] ; then
+ while ! atftp "$BGSERVER" -g -r "$BGPATH" -l ${BGDESTINATION}.tmp ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for background SVG download (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O ${BGDESTINATION}.tmp "$BGURL" ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for background SVG download (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+
+ echo -en "\n$(date +'%F | %T | ')'$0': background SVG download complete." | tee -a /dev/tty8
+ if [ -s ${BGDESTINATION}.tmp ] ; then
+ mv ${BGDESTINATION}.tmp $BGDESTINATION
+ fi
+ ) &
+fi
diff --git a/config/includes.chroot/etc/network/if-up.d/0430-getxroot b/config/includes.chroot/etc/network/if-up.d/0430-getxroot
new file mode 100755
index 0000000..c710cc1
--- /dev/null
+++ b/config/includes.chroot/etc/network/if-up.d/0430-getxroot
@@ -0,0 +1,46 @@
+#!/bin/bash
+export TERM=linux;
+XROOT=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F '=' '$1 == "xroot" { print $2 }' | tr -dc '0-9a-zA-Z,$-_.+!*'"'"'();/?:@=&|')
+IMAGEDIR=/var/tmp/images/
+mkdir -p $IMAGEDIR/background
+
+if [ -n "$XROOT" ] ; then
+
+ if [ "$METHOD" = "loopback" ] || [ "$METHOD" = "none" ]; then
+ exit 0
+ fi
+
+ (
+ while ! [ -c /dev/tty8 ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available."
+ sleep 2
+ done
+ while [ -z "$(hostname -I)" ] ; do
+ echo -en "\n$(date +'%F | %T | ')'$0' is waiting for a client IP." | tee -a /dev/tty8
+ sleep 2
+ done
+
+ echo -en "\n$(date +'%F | %T | ')'$0': Attempting X background download ..." | tee -a /dev/tty8
+ if echo "$XROOT" | grep -q "^tftp://" ; then
+ for SINGLEURL in ${XROOT//|/ }; do
+ XROOTSERVER=$(echo "$SINGLEROOT" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
+ XROOTPATH=$(echo "$SINGLEROOT" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
+ if [ -n "$XROOTSERVER" ] && [ -n "$XROOTPATH" ] ; then
+ while ! (cd ${IMAGEDIR}/background/ && atftp "$XROOTSERVER" -g -r "$XROOTPATH") ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for X background download (tftp) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ fi
+ done
+ elif echo "$XROOT" | grep -q "^://" ; then
+ while ! wget -q -N -P $IMAGEDIR/background ${XROOT//|/ } ; do
+ echo -en "\n$(date +'%F | %T | ')still waiting for X background download (wget) ..." | tee -a /dev/tty8
+ sleep 5
+ done
+ else
+ : # NOP
+ fi
+
+ echo -en "\n$(date +'%F | %T | ')'$0': X background download complete." | tee -a /dev/tty8
+ ) &
+fi
diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime
deleted file mode 100755
index 62242a3..0000000
--- a/config/includes.chroot/lib/live/config/2000-settime
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-SetTime ()
-{
-
-# Output startup message
-#
-echo -n " settime"
-
-cat >/etc/network/if-up.d/0050-settime <<SETTIME
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-NTPSERVERS=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \
- awk -F'=' ' /^ntp=/ { print \$2 }' | \
- tr -dc 'a-zA-Z0-9.\- ' | \
- tr '[:upper:]' '[:lower:]' )
-
-if [ "\$NTPSERVERS" = "false" ] || [ "\$NTPSERVERS" = "off" ] || [ "\$NTPSERVERS" = "0" ] ; then
- NTPCOMMAND="false"
-elif [ -n "\$NTPSERVERS" ] ; then
- echo -en "\n\$(date +'%F | %T | ')'\$0': Using ntp server(s) '\$NTPSERVERS'. First working one in list will be used." | tee -a /dev/tty8
- NTPCOMMAND="ntpdate -s -b \$NTPSERVERS"
-else
- echo -en "\n\$(date +'%F | %T | ')'\$0': Using Debian's default ntp servers." | tee -a /dev/tty8
- NTPCOMMAND="ntpdate-debian -s -b"
-fi
-
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n'\$0' is waiting for tty8 to become available."
- sleep 2
- done
-
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
- while [ -f /var/lock/ntpdate ] ; do
- echo -en "\n'\$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8
- sleep 2
- done
- echo -en "\n\$(date +'%F | %T | ')'\$0': Interface '\$IFACE' is up - attempting to set time via ntp in 20 seconds ..." | tee -a /dev/tty8
-
- sleep 20 # make sure IP, Route, DNS are all up
-
- if [ "\$NTPCOMMAND" = "false" ] ; then
- echo -en "\n\$(date +'%F | %T | ')'\$0' - NTP disabled via boot parameter. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8
- elif \$NTPCOMMAND && hwclock --systohc ; then
- echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8
- else
- echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8
- fi
-) &
-SETTIME
-
-chmod 755 /etc/network/if-up.d/0050-settime
-
-}
-
-SetTime
diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf
deleted file mode 100755
index 70c6625..0000000
--- a/config/includes.chroot/lib/live/config/2100-show-sysconf
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-ShowSysConf ()
-{
-
-# Output startup message
-#
-echo -n " show-sysconf"
-
-# Make sure no language-specific stuff interferes with our matching
-# grep: highlight everything that matches "inet" to the end of its line
-# and also (-E, |$) show every line that has an end => Everything else
-cat >/etc/network/if-up.d/0100-show-sysconf <<SHOWSYSCONF
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- if grep -q findiso /proc/cmdline ; then
- BOOTEDENV=\$(basename \$(dirname \$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F'=' ' \$1 == "findiso" { print \$2 }')) | tr -dc 'a-zA-Z0-9. _\-')
- fi
- for TIMESTAMPFILE in /lib/live/mount/rootfs/*/lib; do
- TIMESTAMP=\$(stat -c %Y \$TIMESTAMPFILE)
- HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP")
- done
-
- # clear old entries
- sed -i '/^- /d' /etc/issue
- # delete motd call from pam login, so we don't get the same greeting twice when logging in locally
- sed -i '/^session optional pam_motd.so/d' /etc/pam.d/login
-
-
- ## enable banner in sshd config if it was disabled
- #sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config
-
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- IPMSG=\$(LANG=C \
- /sbin/ip a | \
- /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \
- GREP_COLOR="1;32" \
- /bin/grep -P --color=always "link/ether .*? |$" )
-
- IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" )
- echo "\$IPMSG" | tee -a /etc/motd >> /etc/issue
- [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" | tee -a /etc/motd >> /etc/issue
- [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" | tee -a /etc/motd >> /etc/issue
-
- # make sure all unused VTs show the new /etc/issue
- ps -C getty --no-header | awk '{ print \$1 }' | xargs -n 1 kill -1
-) &
-SHOWSYSCONF
-
-chmod 755 /etc/network/if-up.d/0100-show-sysconf
-
-}
-
-ShowSysConf
diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver
deleted file mode 100755
index 8a27c3e..0000000
--- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-GetSSHPubKeysFromServer ()
-{
-
- # Output startup message
- #
- echo -n " getsshpubkeysfromserver"
-
-
- PUBKEYURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
- awk -F'=' ' /^pubkey=/ { print $2 }' |\
- tr -dc 'a-zA-Z0-9.:/?%_\-')
-
- if [ -n "$PUBKEYURL" ] ; then
- cat >/etc/network/if-up.d/0200-getsshpubkeysfromserver <<GETPUBKEY
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- # Set Keyfile
- #
- mkdir -p /root/.ssh
- chmod 700 /root/.ssh
- touch /root/.ssh/authorized_keys
- chmod 600 /root/.ssh/authorized_keys
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting SSH public keyfile download ..." | tee -a /dev/tty8
- if echo "$PUBKEYURL" | 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 -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- else
- while ! wget -q -O - "$PUBKEYURL" >/root/.ssh/authorized_keys ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- echo -en "\n\$(date +'%F | %T | ')'\$0': SSH public keyfile download complete." | tee -a /dev/tty8
-) &
-GETPUBKEY
-
- chmod 755 /etc/network/if-up.d/0200-getsshpubkeysfromserver
- fi
-
-}
-
-GetSSHPubKeysFromServer
-
diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf
deleted file mode 100755
index 60b4b56..0000000
--- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-XServerXorgGetXorgConf ()
-{
-# Output startup message
-#
-echo -n " xserver-xorg-getxorgconf"
-
- XORGCONFURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
- awk -F'=' ' /^xorgconfurl=/ { print $2 }' | \
- tr -dc 'a-zA-Z0-9.:/?%_\-')
- if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then
- XORGCONFDESTINATION=/etc/X11/xorg.conf.new
- cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting xorg.conf download ..." | tee -a /dev/tty8
- if echo "$XORGCONFURL" | grep -q "^tftp://" ; then
- XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
- XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
- if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then
- while ! atftp "\$XORGCONFSERVER" -g -r "\$XORGCONFPATH" -l $XORGCONFDESTINATION ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- else
- while ! wget -q -O $XORGCONFDESTINATION "$XORGCONFURL" ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': xorg.conf download complete." | tee -a /dev/tty8
-
- if [ -s $XORGCONFDESTINATION ] ; then
- mv $XORGCONFDESTINATION /etc/X11/xorg.conf
- fi
-) &
-GETXORG
- chmod 755 /etc/network/if-up.d/0300-getxorgconf
- fi
-}
-XServerXorgGetXorgConf
diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions
deleted file mode 100755
index d668cff..0000000
--- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-X2GoGetSessions ()
-{
- # Output startup message
- #
- echo -n " x2go-getsessions"
-
- SESSIONSURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
- awk -F'=' ' /^sessionsurl=/ { print $2 }' | \
- tr -dc 'a-zA-Z0-9.:/?%_\-')
- if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then
- # only mv this file if SESSIONSURL was set. If not, leave it in place - as
- # it might have been customized at image creation time
- mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old
- SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new
- cat >/etc/network/if-up.d/0400-getsessions <<GETSESS
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting session config data download ..." | tee -a /dev/tty8
- 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 -en "\n\$(date +'%F | %T | ')still waiting for session config data (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- else
- while ! wget -q -O $SESSIONSDESTINATION "$SESSIONSURL" ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for session config data (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': session config data download complete." | tee -a /dev/tty8
- if [ -s $SESSIONSDESTINATION ] ; then
- mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions
- fi
-) &
-GETSESS
- chmod 755 /etc/network/if-up.d/0400-getsessions
- fi
-}
-
-X2GoGetSessions
diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding
deleted file mode 100755
index 6147dd6..0000000
--- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-X2GoGetBranding ()
-{
- # Output startup message
- #
- echo -n " x2go-getbranding"
-
-
- BRANDINGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
- awk -F'=' ' /^branding=/ { print $2 }' | \
- tr -dc 'a-zA-Z0-9.:/?%_\-')
- BRANDINGDESTINATION=/etc/x2go/branding.svg
-
- if [ -n "$BRANDINGURL" ] ; then
- cat >/etc/network/if-up.d/0410-getbranding <<GETBRAND
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting branding SVG download ..." | tee -a /dev/tty8
- if echo "$BRANDINGURL" | grep -q "^tftp://" ; then
- BRANDINGSERVER=$(echo "$BRANDINGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' )
- BRANDINGPATH=$(echo "$BRANDINGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' )
- if [ -n "\$BRANDINGSERVER" ] && [ -n "\$BRANDINGPATH" ] ; then
- while ! atftp "\$BRANDINGSERVER" -g -r "\$BRANDINGPATH" -l ${BRANDINGDESTINATION}.tmp ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- else
- while ! wget -q -O ${BRANDINGDESTINATION}.tmp "$BRANDINGURL" ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': branding SVG download complete." | tee -a /dev/tty8
- if [ -s ${BRANDINGDESTINATION}.tmp ] ; then
- mv ${BRANDINGDESTINATION}.tmp $BRANDINGDESTINATION
- fi
-) &
-GETBRAND
- chmod 755 /etc/network/if-up.d/0410-getbranding
- fi
-}
-
-X2GoGetBranding
diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg
deleted file mode 100755
index 67a5660..0000000
--- a/config/includes.chroot/lib/live/config/2720-x2go-getbg
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-X2GoGetBG ()
-{
- # Output startup message
- #
- echo -n " x2go-getbg"
-
-
- BGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
- awk -F'=' ' /^bg=/ { print $2 }' | \
- tr -dc 'a-zA-Z0-9.:/?%_\-')
- BGDESTINATION=/etc/x2go/bg.svg
-
- if [ -n "$BGURL" ] ; then
- cat >/etc/network/if-up.d/0420-getbg <<GETBG
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting background SVG download ..." | tee -a /dev/tty8
- if echo "$BGURL" | grep -q "^tftp://" ; then
- BGSERVER=$(echo "$BGURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
- BGPATH=$(echo "$BGURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
- if [ -n "\$BGSERVER" ] && [ -n "\$BGPATH" ] ; then
- while ! atftp "\$BGSERVER" -g -r "\$BGPATH" -l ${BGDESTINATION}.tmp ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- else
- while ! wget -q -O ${BGDESTINATION}.tmp "$BGURL" ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': background SVG download complete." | tee -a /dev/tty8
- if [ -s ${BGDESTINATION}.tmp ] ; then
- mv ${BGDESTINATION}.tmp $BGDESTINATION
- fi
-) &
-GETBG
- chmod 755 /etc/network/if-up.d/0420-getbg
- fi
-}
-
-X2GoGetBG
diff --git a/config/includes.chroot/lib/live/config/2730-x2go-getxbackground b/config/includes.chroot/lib/live/config/2730-x2go-getxbackground
deleted file mode 100755
index 9e818a4..0000000
--- a/config/includes.chroot/lib/live/config/2730-x2go-getxbackground
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-X2GoGetXROOT ()
-{
- # Output startup message
- #
- echo -n " x2go-getxroot"
-
-
- XROOT=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F '=' '$1 == "xroot" { print $2 }' | tr -dc '0-9a-zA-Z,$-_.+!*'"'"'();/?:@=&|')
- IMAGEDIR=/var/tmp/images/
- mkdir -p $IMAGEDIR/background
-
- if [ -n "$XROOT" ] ; then
- cat >/etc/network/if-up.d/0430-getxroot <<GETXROOT
-#!/bin/bash
-export TERM=linux;
-
-if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then
- exit 0
-fi
-
-(
- while ! [ -c /dev/tty8 ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available."
- sleep 2
- done
- while [ -z "\$(hostname -I)" ] ; do
- echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8
- sleep 2
- done
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting X background download ..." | tee -a /dev/tty8
- if echo "$XROOT" | grep -q "^tftp://" ; then
- for SINGLEURL in ${XROOT//|/ }; do
- XROOTSERVER=$(echo "$SINGLEROOT" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' )
- XROOTPATH=$(echo "$SINGLEROOT" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' )
- if [ -n "\$XROOTSERVER" ] && [ -n "\$XROOTPATH" ] ; then
- while ! (cd ${IMAGEDIR}/background/ && atftp "\$XROOTSERVER" -g -r "\$XROOTPATH") ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for X background download (tftp) ..." | tee -a /dev/tty8
- sleep 5
- done
- fi
- done
- elif echo "$XROOT" | grep -q "^://" ; then
- while ! wget -q -N -P $IMAGEDIR/background ${XROOT//|/ } ; do
- echo -en "\n\$(date +'%F | %T | ')still waiting for X background download (wget) ..." | tee -a /dev/tty8
- sleep 5
- done
- else
- : # NOP
- fi
-
- echo -en "\n\$(date +'%F | %T | ')'\$0': X background download complete." | tee -a /dev/tty8
-) &
-GETXROOT
- chmod 755 /etc/network/if-up.d/0430-getxroot
- fi
-}
-
-X2GoGetXROOT
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
More information about the x2go-commits
mailing list