diff options
author | torben | 2018-09-03 19:38:03 +0200 |
---|---|---|
committer | torben | 2018-09-03 19:38:03 +0200 |
commit | 8b3f442ac5f22e23504aa23feec8b0b283a173fe (patch) | |
tree | 6a6845b098c90784151e43286cd95b6cd1c12231 | |
parent | Interface now working without given parameter (auto detection!). (diff) | |
download | systemd-init-8b3f442ac5f22e23504aa23feec8b0b283a173fe.tar.gz systemd-init-8b3f442ac5f22e23504aa23feec8b0b283a173fe.tar.xz systemd-init-8b3f442ac5f22e23504aa23feec8b0b283a173fe.zip |
Improve dhcp configuration.
-rwxr-xr-x | modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh b/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh index 938fbfaa..55ac1299 100755 --- a/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh +++ b/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh @@ -29,19 +29,12 @@ if [ "$SLX_VLAN_ID" = '' ]; then if [[ "$SLX_BRIDGE" != '' ]]; then MATCH_LINE="Name=$SLX_BRIDGE" MAIN_NETIF_CONF="$NETWORKD_DIR/$SLX_BRIDGE.network" - elif [[ "$SLX_PXE_MAC" != '' ]]; then - MATCH_LINE="MACAddress=$SLX_PXE_MAC" - MAIN_NETIF_CONF="$NETWORKD_DIR/$SLX_PXE_NETIF.network" else - emergency_shell "Could not determine network configuration mode!" + MATCH_LINE="Name=$SLX_PXE_NETIF" + MAIN_NETIF_CONF="$NETWORKD_DIR/$SLX_PXE_NETIF.network" fi # backup current network config for later reference before overwritting it - if [ -f "$MAIN_NETIF_CONF" ]; then - mv "$NEWROOT/$MAIN_NETIF_CONF" "$NEWROOT/$MAIN_NETIF_CONF.stage3" - else - emergency_shell \ - "Failed to find main networkd configuration: $MAIN_NETIF_CONF" - fi + mv "$NEWROOT/$MAIN_NETIF_CONF" "$NEWROOT/$MAIN_NETIF_CONF.stage3" # Now generate a DHCP configuration for the main interface cat << EOF > "$NEWROOT/$MAIN_NETIF_CONF" [Match] |