summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/slx-network/udhcpc-trigger
diff options
context:
space:
mode:
authorJonathan Bauer2019-07-31 17:42:45 +0200
committerJonathan Bauer2019-07-31 17:42:45 +0200
commitd817221b938a14e1e8af3ce9abe531bce659d70c (patch)
treea46427bbc866fc0ced384063fd272c9a9b507d92 /builder/modules.d/slx-network/udhcpc-trigger
parent[slx-partitioner] renamed to slx-dmsetup (diff)
downloadsystemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.tar.gz
systemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.tar.xz
systemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.zip
[slx-network] setup network on udev settles
instead of checking in the finished hooks. NOTE: this might still cause problems, if udev finds the main boot interface first, triggers setup-network.sh which starts looping over interfaces before udev had a chance to discover every single one. The bridge creation stuff might be better appropriate in stage4!
Diffstat (limited to 'builder/modules.d/slx-network/udhcpc-trigger')
-rwxr-xr-xbuilder/modules.d/slx-network/udhcpc-trigger12
1 files changed, 7 insertions, 5 deletions
diff --git a/builder/modules.d/slx-network/udhcpc-trigger b/builder/modules.d/slx-network/udhcpc-trigger
index 17d73f51..9a056a6c 100755
--- a/builder/modules.d/slx-network/udhcpc-trigger
+++ b/builder/modules.d/slx-network/udhcpc-trigger
@@ -4,14 +4,15 @@ exec >> /run/openslx/udhcpc-trigger.log
exec 2>> /run/openslx/udhcpc-trigger.log
set -x
-if [ "x$1" != "xbound" -a "x$1" != "xrenew" ] || [ "x$interface" != "xbr0" ] || [ -z "$ip" ]; then
- exit 0
-fi
-
NETWORK_CONF="/run/openslx/network.conf"
-
. "$NETWORK_CONF"
+if [ "x$1" != "xbound" -a "x$1" != "xrenew" ] \
+ || [ "x$interface" != "${SLX_BRIDGE:-${SLX_PXE_NETIF}" ] \
+ || [ -z "$ip" ]; then
+ exit 0
+fi
+
# If we already got an IP from KCL, see if it differs, and remove first if so
# We just try to prevent everything from breaking if the DHCP server doesn't
# objey the renew request by the client and hands out a new address
@@ -112,3 +113,4 @@ if [ -n "$hostname" ]; then
echo "SLX_HOSTNAME='$hostname'" >> "/run/openslx/network.conf"
fi
+touch /.network