]> code.x2go.org Git - live-build-x2go.git/commitdiff
Fixup last patch: more quotes, no useless use of cat.
authorMihai Moldovan <ionic@ionic.de>
Tue, 25 Apr 2017 21:14:18 +0000 (23:14 +0200)
committerMihai Moldovan <ionic@ionic.de>
Tue, 25 Apr 2017 21:14:18 +0000 (23:14 +0200)
config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig

index 1cb0cbb394736b148207c0b1ba7b193807e666b1..49b9f0f8e0f85d4471be6c4e1cbcad83115b3009 100755 (executable)
@@ -142,13 +142,13 @@ fi
 ADDOPTS=""
 
 # append custom background image if one was retrieved to additional options
-if [ -e /home/user/custom/background.svg ]; then
-    ADDOPTS="\$ADDOPTS --background=/home/user/custom/background.svg"
+if [ -e "/home/user/custom/background.svg" ]; then
+    ADDOPTS="\$ADDOPTS --background='/home/user/custom/background.svg'"
 fi
 
 # append custom branding image if one was retrieved to additional options
-if [ -e /home/user/custom/background.svg ]; then
-    ADDOPTS="\$ADDOPTS --branding=/home/user/custom/branding.svg"
+if [ -e "/home/user/custom/background.svg" ]; then
+    ADDOPTS="\$ADDOPTS --branding='/home/user/custom/branding.svg'"
 fi
 
 x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$ADDOPTS
@@ -163,27 +163,25 @@ chown user:user /home/user/{export,logins,mounts}
 chmod 700 /home/user/{export,logins,mounts}
 
 # handle custom images passed in on boot parameters
-mkdir /home/user/custom
-chown user:user /home/user/custom
-chmod 755 /home/user/custom
-BGURL=$(cat /proc/cmdline | \
-    tr ' ' '\n' | \
-    awk -F'=' ' /^backgroundurl=/ { print $2 }')
-if [ -n $BGURL ]; then
-    /usr/bin/wget $BGURL -q -O /home/user/custom/background.svg
+mkdir "/home/user/custom"
+chown user:user "/home/user/custom"
+chmod 755 "/home/user/custom"
+BGURL="$(tr ' ' '\n' < /proc/cmdline | \
+    awk -F'=' ' /^backgroundurl=/ { print $2 }')"
+if [ -n "$BGURL" ]; then
+    /usr/bin/wget "$BGURL" -q -O "/home/user/custom/background.svg"
 fi
-BRNDURL=$(cat /proc/cmdline | \
-    tr ' ' '\n' | \
-    awk -F'=' ' /^brandingurl=/ { print $2 }')
-if [ -n $BRNDURL ]; then
-    /usr/bin/wget $BRNDURL -q -O /home/user/custom/branding.svg
+BRNDURL="$(tr ' ' '\n' < /proc/cmdline | \
+    awk -F'=' ' /^brandingurl=/ { print $2 }')"
+if [ -n "$BRNDURL" ]; then
+    /usr/bin/wget "$BRNDURL" -q -O "/home/user/custom/branding.svg"
 fi
 
 #only try to set permissions if files exist
-CUSTFILES=(/home/user/custom/*)
-if [ -e ${CUSTFILES[0]} ]; then
-    chown user:user /home/user/custom/*
-    chmod 644 /home/user/custom/*
+CUSTFILES=("/home/user/custom/"*)
+if [ -e "${CUSTFILES[0]}" ]; then
+    chown user:user "/home/user/custom/"*
+    chmod 644 "/home/user/custom/"*
 fi
 
 }