From 7f85c9327c4578fa1e75e37ab78554a8802f75b5 Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Thu, 2 Apr 2020 16:20:51 +0200 Subject: [PATCH] netcardconfig: Run ifdown immediately before configuring the network device When running netcardconfig the network device is set offline before the configuration is completed. The network configuration should only be touched after everything is set. While at it also removed the sleep phase. The network interface should be released and down fine after ifdown is completed. Closes: grml/grml-network#8 --- sbin/netcardconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/netcardconfig b/sbin/netcardconfig index cffa86a..35c1851 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -1,5 +1,5 @@ #!/bin/bash -# Filename: grml-network +# Filename: netcardconfig # Purpose: configuration script for network # Authors: Michael Prokop , Marcel Wichern 2006, Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2004-2007 # Bug-Reports: see http://grml.org/bugs/ @@ -188,8 +188,7 @@ configiface() { DEVICE=${NETDEVICES[$DV]} device2props DV=$DEVICENAME - ifdown "${DV}" --force - sleep 3 + # INTERACTIVE=true if "${INTERACTIVE}" ; then # Setup wireless options? @@ -712,6 +711,7 @@ while (true); do IFACEDONE="" while [ -n "$DV" ] && [ -z "$IFACEDONE" ]; do configiface "${METHOD}" "${IPADDR}" "${NETMASK}" "${GATEWAY}" "${DNS}" + ifdown "${DV}" --force if ! ifup $DV; then if "${INTERACTIVE}" ; then $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"