aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-eth
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifdown-eth')
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth12
1 files changed, 7 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 56ea2725..cd91e766 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
. /etc/init.d/functions
@@ -56,7 +56,7 @@ fi
fi
if is_bonding_device ${DEVICE} ; then
- for device in $(LANG=C egrep -l "^[[:space:]]*MASTER=\"?${DEVICE}\"?[[:space:]]*$" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
is_ignored_file "$device" && continue
/sbin/ifdown ${device##*/}
done
@@ -139,9 +139,9 @@ fi
# instance instead.
if [ -d "/sys/class/net/${REALDEVICE}" ]; then
if [ "${REALDEVICE}" = "${DEVICE}" ]; then
- ip addr flush dev ${REALDEVICE} 2>/dev/null
+ ip addr flush dev ${REALDEVICE} scope global 2>/dev/null
else
- ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} scope global 2>/dev/null
fi
if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
@@ -171,7 +171,9 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
fi
if [ "${TYPE}" = "Tap" ]; then
- tunctl -d "${DEVICE}" >/dev/null
+ TUNMODE="mode tap"
+ [[ ${DEVICE} == tun* ]] && TUNMODE="mode tun"
+ ip tuntap del ${TUNMODE} dev ${DEVICE} >/dev/null
fi
# wait up to 5 seconds for device to actually come down...