summaryrefslogtreecommitdiffstats
path: root/core/modules/dhcpc-busybox
diff options
context:
space:
mode:
authorSimon Rettberg2018-07-23 12:18:15 +0200
committerSimon Rettberg2018-07-23 12:18:15 +0200
commit999f9d40096a39ee38f813275dc0b733fe2ce438 (patch)
tree79890ed9e665256f023a16a40ddc4c6bef7e5dce /core/modules/dhcpc-busybox
parent[dnbd3-proxy] Scale maxReplicationSize according to cache partition (diff)
downloadmltk-999f9d40096a39ee38f813275dc0b733fe2ce438.tar.gz
mltk-999f9d40096a39ee38f813275dc0b733fe2ce438.tar.xz
mltk-999f9d40096a39ee38f813275dc0b733fe2ce438.zip
[dhcpc-busybox] Lowercase variable names
UID collided with a read-only bash builtin. It's recommended anyways to use lowercase variable names in shell scripts, so let's do this...
Diffstat (limited to 'core/modules/dhcpc-busybox')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
index 4548d1d1..608ec846 100755
--- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
+++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++
@@ -1,27 +1,27 @@
#!/bin/bash
-NET_IF="$1"
-NET_IP="$(ip addr show dev "${NET_IF}" | grep -m1 '^\s*inet ' | awk -F " " '{print $2}' | awk -F "/" '{print $1}')"
+net_if="$1"
+net_ip="$(ip addr show dev "${net_if}" | grep -m1 '^\s*inet ' | awk -F " " '{print $2}' | awk -F "/" '{print $1}')"
-UDHCPC_OPTS=""
-if [ -n "$NET_IP" ]; then
- UDHCPC_OPTS="$UDHCPC_OPTS -r $NET_IP"
+udhcpc_opts=""
+if [ -n "$net_ip" ]; then
+ udhcpc_opts="$udhcpc_opts -r $net_ip"
fi
-UID=$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/')
-if [ "${#UID}" = 34 ]; then
- echo "Using SMBIOS UID for DHCP"
- UDHCPC_OPTS="$UDHCPC_OPTS -x 0x3d:$UID"
+uid=$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/')
+if [ "${#uid}" = 34 ]; then
+ echo "Using SMBIOS uid for DHCP"
+ udhcpc_opts="$udhcpc_opts -x 0x3d:$uid"
fi
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 -O wins -t 8 -s /opt/openslx/scripts/udhcpc-openslx -i "$NET_IF" -p "/run/udhcpc/udhcpc.$NET_IF.pid"
-RET=$?
+/opt/openslx/sbin/udhcpc ${udhcpc_opts} -O domain -O nissrv -O nisdomain -O wpad -O search -O wins -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}."
+if [ "${ret}" != 0 ]; then
+ slxlog "udhcpc" "Could not run 'udhcpc ${udhcpc_opts}' on ${net_if}."
fi
-exit "$RET"
+exit "${ret}"