aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-aliases
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-07-26 14:52:05 +0000
committerBill Nottingham <notting@redhat.com>1999-07-26 14:52:05 +0000
commit6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814 (patch)
tree7e8210ea7938b95a6664d6af59f47790db059fb9 /sysconfig/network-scripts/ifdown-aliases
parent846e98a797129bb4165acff138a8c23992743e77 (diff)
downloadinitscripts-6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814.tar
initscripts-6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814.tar.gz
initscripts-6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814.tar.bz2
initscripts-6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814.tar.xz
initscripts-6ebf4ab2cf081ed78d86b42a6ae61bc35edf6814.zip
speedup fixes for ifup-aliases from David Harris (dharris@drh.net)
Diffstat (limited to 'sysconfig/network-scripts/ifdown-aliases')
-rwxr-xr-xsysconfig/network-scripts/ifdown-aliases28
1 files changed, 28 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown-aliases b/sysconfig/network-scripts/ifdown-aliases
new file mode 100755
index 00000000..6334d2f5
--- /dev/null
+++ b/sysconfig/network-scripts/ifdown-aliases
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# removes aliases of device $1
+
+device=$1
+if [ "$device" = "" ]; then
+ echo "usage: $0 <net-device>"
+ exit 1
+fi
+
+parent_device=$device
+
+. network-functions
+
+# This is the same messy sed script as in the ifup-aliases script.
+eval ` ifconfig | sed -e ' /^[^[:space:]]*:[0-9]*/ { s|^\([^:]*\):\([0-9]*\).*$|X=x; TMP="\2"; [ "$device" != "\1" ] \|\| |g; b; }; /^[^[:space:]]/ { s|.*|X=x; [ 0 = 0 ] \|\| |g; b; }; /inet addr:[0-9]*\.[0-9]*\.[0-9]*\.[0-9]* *Bcast:[0-9.]* *Mask:[0-9.]*/ { s|^.*inet addr:\(\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\) *Bcast:\([0-9.]*\) *Mask:\([0-9.]*\).*$|eval " rdev_${TMP}_addr=\1; rdev_${TMP}_mb=\7_\6; rdevip_\2_\3_\4_\5=${TMP}; rdev_LIST=\\\\"\\\\$rdev_LIST \\\\${TMP}\\\\"; " \|\| |g; b; }; s|^.*$||g; ' ` X=x;
+
+for DEVNUM in $rdev_LIST ; do
+ ifconfig $parent_device:$DEVNUM down
+ do_netreport=yes
+done
+
+# notify programs that have requested notification, if we changed anything
+if [ -n "$do_netreport" ]; then
+ do_netreport
+fi
+
+