[X2Go-Commits] [live-build-x2go] 126/160: replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values
git-admin at x2go.org
git-admin at x2go.org
Sat Nov 18 01:55:51 CET 2017
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 391d50014230e7f2b7f37ad84a28142cac605ded
Author: Stefan Baur <kontakt at baur-itcs.de>
Date: Wed Oct 25 19:50:53 2017 +0200
replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values
---
.../lib/live/config/2250-getsshpubkeysfromserver | 2 +-
.../lib/live/config/2300-xserver-xorg-getxorgconf | 2 +-
.../includes.chroot/lib/live/config/2400-live-autoupdate | 14 +++++++-------
config/includes.chroot/lib/live/config/2600-tcpprint | 2 +-
.../includes.chroot/lib/live/config/2700-x2go-getsessions | 2 +-
.../includes.chroot/lib/live/config/2710-x2go-getbranding | 2 +-
config/includes.chroot/lib/live/config/2720-x2go-getbg | 2 +-
.../lib/live/config/2900-x2go-thinclientconfig | 14 +++++++-------
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver
index 2e278cc..76152fa 100755
--- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver
+++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver
@@ -9,7 +9,7 @@ GetSSHPubKeysFromServer ()
PUBKEYURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^pubkey=/ { print $2 }')
if [ -n "$PUBKEYURL" ] ; then
diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf
index a5e0a4b..9824e8d 100755
--- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf
+++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf
@@ -7,7 +7,7 @@ XServerXorgGetXorgConf ()
echo -n " xserver-xorg-getxorgconf"
XORGCONFURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^xorgconfurl=/ { print $2 }')
if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then
XORGCONFDESTINATION=/etc/X11/xorg.conf.new
diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate
index 5a8f8ca..08649a7 100755
--- a/config/includes.chroot/lib/live/config/2400-live-autoupdate
+++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate
@@ -119,7 +119,7 @@ echo -n " live-autoupdater (backgrounding update task)"
unset LC_MESSAGES
# Define our mountpoint and check if we're capable of auto-updating
- NTFSROOT=$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '/^ntfs-uuid/ { print $2 }')
+ NTFSROOT=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '/^ntfs-uuid/ { print $2 }')
if [ -n "$NTFSROOT" ]; then
mkdir -p /lib/live/mount/ntfsroot
# This is in case we've been passed an incomplete UUID and/or one with dashes
@@ -128,7 +128,7 @@ echo -n " live-autoupdater (backgrounding update task)"
if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then
NTFSROOT=$(echo $NTFSROOT | tr -d '-')
if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then
- NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1))
+ NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | sed -e 's/ \([^ ]*\)=/\n\1=/g' | head -1))
fi
fi
@@ -163,7 +163,7 @@ echo -n " live-autoupdater (backgrounding update task)"
# determine our booted environment as well as the other available ones
RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^findiso=/ { print $2 }')"))
ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH)
@@ -171,7 +171,7 @@ echo -n " live-autoupdater (backgrounding update task)"
# download url pointing to directory with all required files goes here
DOWNLOADURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^updateurl=/ { print $2 }')
if [ -z "$DOWNLOADURL" ]; then
@@ -183,7 +183,7 @@ echo -n " live-autoupdater (backgrounding update task)"
echo -n "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions."
LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}')
TEMPMOUNT=$(mktemp -d -p /lib/live/mount/)
- FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }')
+ FINDFILE=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '$1 == "findiso" { print $2 }')
[ -z "$FINDFILE" ] && exit 0
for PARTITION in $LISTOFPARTITIONS ; do
mount -oro $PARTITION $TEMPMOUNT
@@ -214,7 +214,7 @@ echo -n " live-autoupdater (backgrounding update task)"
#
#BWLIMITPERCENT=20 # in percent, numeric-only
BWLIMITPERCENT=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^bwlimit=/ { print $2 }')
if [ -z "$BWLIMITPERCENT" ]; then
BWLIMITPERCENT=20
@@ -225,7 +225,7 @@ echo -n " live-autoupdater (backgrounding update task)"
# sleeping a random amount of time to ease load on the update server
#
MAXSLEEPTIME=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }')
if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then
MAXSLEEPTIME=900
diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint
index 1da6e7b..c25747e 100755
--- a/config/includes.chroot/lib/live/config/2600-tcpprint
+++ b/config/includes.chroot/lib/live/config/2600-tcpprint
@@ -10,7 +10,7 @@ echo -n " tcpprint"
if grep -q "\W*tcpprint\W*" /proc/cmdline ; then
TCPPRINTONLYFROM=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }')
if [ -n "$TCPPRINTONLYFROM" ] ; then
TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM"
diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions
index 6a4901c..4488e60 100755
--- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions
+++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions
@@ -7,7 +7,7 @@ X2GoGetSessions ()
echo -n " x2go-getsessions"
SESSIONSURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^sessionsurl=/ { print $2 }')
if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then
# only mv this file if SESSIONSURL was set. If not, leave it in place - as
diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding
index f652c2f..e100b68 100755
--- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding
+++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding
@@ -8,7 +8,7 @@ X2GoGetBranding ()
BRANDINGURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^branding=/ { print $2 }')
BRANDINGDESTINATION=/etc/x2go/branding.svg
diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg
index a3855be..83b9927 100755
--- a/config/includes.chroot/lib/live/config/2720-x2go-getbg
+++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg
@@ -8,7 +8,7 @@ X2GoGetBG ()
BGURL=$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^bg=/ { print $2 }')
BGDESTINATION=/etc/x2go/bg.svg
diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
index dea8f09..821b103 100755
--- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
+++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
@@ -28,7 +28,7 @@ cat >/home/user/.xsession <<XSESSION
pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 'module-udev-detect' --exit-idle-time=65535 &
# additional variable instead of "case \$(...) in", as we need the value again later on
-XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "xinerama" { print \$2 }')
+XRANDRCMDTAINTED=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "xinerama" { print \$2 }')
# sanitize input
case \$XRANDRCMDTAINTED in
@@ -90,21 +90,21 @@ xsetroot -solid "#246ed8"
# Get X2GoConfig
BROKERURL=\$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^broker-url=/ { print \$2 }')
SESSIONSELECT=\$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
awk -F'=' ' /^session=/ { print \$2 }')
LDAP=\$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
sed 's/^ldap=/ldap#/' | \
awk -F'#' ' /^ldap#/ { print \$2 }')
LDAP1=\$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
sed 's/^ldap1=/ldap1#/' | \
awk -F'#' ' /^ldap1#/ { print \$2 }')
LDAP2=\$(cat /proc/cmdline | \
- tr ' ' '\n' | \
+ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \
sed 's/^ldap2=/ldap2#/' | \
awk -F'#' ' /^ldap2#/ { print \$2 }')
@@ -161,7 +161,7 @@ else
LDAPPARAMS=""
fi
-BLANKINGTIME=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "blank" { print \$2 }')
+BLANKINGTIME=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "blank" { print \$2 }')
if [ -n "\$BLANKINGTIME" ]; then
DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}'))
if [ \${DPMSARR[0]} -eq 0 ]; then
--
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