Skip to content

Commit

Permalink
netcardconfig: Run ifdown immediately before configuring the network …
Browse files Browse the repository at this point in the history
…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#8
  • Loading branch information
jkirk committed Apr 2, 2020
1 parent 1d6c179 commit 7f85c93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sbin/netcardconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Filename: grml-network
# Filename: netcardconfig
# Purpose: configuration script for network
# Authors: Michael Prokop <[email protected]>, Marcel Wichern 2006, Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2004-2007
# Bug-Reports: see http://grml.org/bugs/
Expand Down Expand Up @@ -188,8 +188,7 @@ configiface() {
DEVICE=${NETDEVICES[$DV]}
device2props
DV=$DEVICENAME
ifdown "${DV}" --force
sleep 3

# INTERACTIVE=true
if "${INTERACTIVE}" ; then
# Setup wireless options?
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7f85c93

Please sign in to comment.