From 8b3f442ac5f22e23504aa23feec8b0b283a173fe Mon Sep 17 00:00:00 2001 From: torben Date: Mon, 3 Sep 2018 19:38:03 +0200 Subject: Improve dhcp configuration. --- .../hooks/configure-dhcp-for-newroot.sh | 13 +++---------- 1 file 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] -- cgit v1.2.3-55-g7522