summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-07 16:19:04 +0100
committerSimon Rettberg2016-01-07 16:19:04 +0100
commitfc0683176b88de4736e8a51ad688ca76d90261f9 (patch)
tree18aa5b7bf70dce943801990853c83a80a0cde09b /remote
parent[printergui] Delete temp file after printing (diff)
downloadtm-scripts-fc0683176b88de4736e8a51ad688ca76d90261f9.tar.gz
tm-scripts-fc0683176b88de4736e8a51ad688ca76d90261f9.tar.xz
tm-scripts-fc0683176b88de4736e8a51ad688ca76d90261f9.zip
[beamergui,udhcpc] Don't create pointless files in /tmp
Diffstat (limited to 'remote')
-rwxr-xr-xremote/modules/beamergui/data/etc/X11/Xsession.d/98-modesetter-wrapper6
-rwxr-xr-xremote/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++14
2 files changed, 14 insertions, 6 deletions
diff --git a/remote/modules/beamergui/data/etc/X11/Xsession.d/98-modesetter-wrapper b/remote/modules/beamergui/data/etc/X11/Xsession.d/98-modesetter-wrapper
index 7602eabc..59c1c8ed 100755
--- a/remote/modules/beamergui/data/etc/X11/Xsession.d/98-modesetter-wrapper
+++ b/remote/modules/beamergui/data/etc/X11/Xsession.d/98-modesetter-wrapper
@@ -1,5 +1,5 @@
-#!/bin/ash
+# Beamergui detection and setup
# Explicitely call bash for the modesetter
-/bin/bash /opt/openslx/scripts/beamergui-mode_setter \
- >/tmp/$UID-modesetter.$$.log 2>&1
+/bin/bash /opt/openslx/scripts/beamergui-mode_setter >/dev/null 2>&1
+
diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
index 246b2567..76c4fe95 100755
--- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
+++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
@@ -1,11 +1,19 @@
#!/bin/bash
NET_IF="$1"
-NET_IP="$(ip addr show dev "${NET_IF}" | grep "inet " | awk -F " " '{print $2}' | awk -F "/" '{print $1}')"
+NET_IP="$(ip addr show dev "${NET_IF}" | grep -m1 '^\s*inet ' | awk -F " " '{print $2}' | awk -F "/" '{print $1}')"
UDHCPC_OPTS=""
[ ! -z "$NET_IP" ] && UDHCPC_OPTS=" -r $NET_IP"
-echo "udhcp++: running on $NET_IF with additional params $UDHCPC_OPTS" >> "/tmp/udhcpclog"
+
mkdir -p /run/udhcpc || echo "Could not create '/run/udhcpc'."
-/opt/openslx/sbin/udhcpc $UDHCPC_OPTS -O domain -O nissrv -O nisdomain -O wpad -O search -t 8 -s /opt/openslx/scripts/udhcpc-openslx -i "$NET_IF" -p "/run/udhcpc/udhcpc.$NET_IF.pid" || \
+
+/opt/openslx/sbin/udhcpc $UDHCPC_OPTS -O domain -O nissrv -O nisdomain -O wpad -O search -t 8 -s /opt/openslx/scripts/udhcpc-openslx -i "$NET_IF" -p "/run/udhcpc/udhcpc.$NET_IF.pid"
+RET=$?
+
+if [ "$RET" != 0 ]; then
slxlog "udhcpc" "Could not run 'udhcpc${UDHCPC_OPTS}' on ${NET_IF}."
+fi
+
+exit "$RET"
+