aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-aliases
diff options
context:
space:
mode:
authorMichael K. Johnson <johnsonm@redhat.com>1998-05-02 21:37:53 +0000
committerMichael K. Johnson <johnsonm@redhat.com>1998-05-02 21:37:53 +0000
commitb7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58 (patch)
tree2d1fdbf73df6a9e44d3510e3aef77c7421a50d8f /sysconfig/network-scripts/ifup-aliases
parent7da45feaa8f70f28fc1278f22bcd07956517964d (diff)
downloadinitscripts-b7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58.tar
initscripts-b7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58.tar.gz
initscripts-b7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58.tar.bz2
initscripts-b7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58.tar.xz
initscripts-b7ef7c3cd0bcce1c4d77694be607b6b8d81fcc58.zip
linuxconf supportr3-56
Diffstat (limited to 'sysconfig/network-scripts/ifup-aliases')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases40
1 files changed, 40 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
new file mode 100755
index 00000000..39233819
--- /dev/null
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# adds aliases of device $1
+
+if [ "$1" = "" ]; then
+ echo "usage: $0 <net-device>"
+ exit 1
+fi
+
+if [ -x /bin/linuxconf ] ; then
+ # ask linuxconf for lines like:
+ # add <device> <ip>
+ # del <device>
+ # reload <number_of_aliases>
+ linuxconf --hint ipalias $1 | while read verb arg1 arg2 ; do
+ case $verb in
+ add)
+ /sbin/ifconfig $arg1 $arg2
+ /sbin/route add $arg2 $arg1
+ ;;
+ del)
+ # the <device>- 0.0.0.0 tells the kernel to remove the device
+ # it is necessary to remove it in order for reload to work.
+ /sbin/ifconfig ${arg1}- 0.0.0.0
+ ;;
+ reload)
+ echo $arg1 > /proc/sys/net/core/net_alias_max
+ ;;
+ esac
+ done
+
+else
+ # we don't have linuxconf to fall back on, so presumably we do
+ # not have to parse linuxconf ipalias ranges, either.
+ allow_null_glob_expansion=foo
+ for alias in /etc/sysconfig/network-scripts/ifcfg-$1:* ; do
+ /etc/sysconfig/network-scripts/ifup $alias
+ done
+ unset allow_null_glob_expansion
+fi