aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-aliases
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-04-08 16:04:26 +0000
committerBill Nottingham <notting@redhat.com>1999-04-08 16:04:26 +0000
commit44e8ff24a4a674818c27e9435274333a99c4e02e (patch)
treec03f45b260266105c92dbd0198bd7d1288984459 /sysconfig/network-scripts/ifup-aliases
parent0685abf5cf2c7ac25482006491f3959709c2bcb7 (diff)
downloadinitscripts-44e8ff24a4a674818c27e9435274333a99c4e02e.tar
initscripts-44e8ff24a4a674818c27e9435274333a99c4e02e.tar.gz
initscripts-44e8ff24a4a674818c27e9435274333a99c4e02e.tar.bz2
initscripts-44e8ff24a4a674818c27e9435274333a99c4e02e.tar.xz
initscripts-44e8ff24a4a674818c27e9435274333a99c4e02e.zip
check for 2.0 kernels before doing some stuff
Diffstat (limited to 'sysconfig/network-scripts/ifup-aliases')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases12
1 files changed, 10 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index 81bad57a..ad4d195c 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -13,6 +13,10 @@ if [ -x /bin/linuxconf -a -f /usr/lib/libncurses.so.4.2 ] ; then
# add <device> <ip>
# del <device>
# reload <number_of_aliases>
+ KERN20=
+ if uname -r | grep -q "^2\.0"; then
+ KERN20=true
+ fi
linuxconf --hint ipalias $1 | while read verb arg1 arg2 arg3 arg4; do
case $verb in
add)
@@ -23,12 +27,16 @@ if [ -x /bin/linuxconf -a -f /usr/lib/libncurses.so.4.2 ] ; then
# new linuxconf
/sbin/ifconfig $arg1 $arg2 netmask $arg3 broadcast $arg4
fi
- /sbin/route add $arg2 $arg1
+ [ -n "$KERN20" ] && /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
+ if [ -n "$KERN20" ]; then
+ /sbin/ifconfig ${arg1}- 0.0.0.0
+ else
+ /sbin/ifconfig ${arg1} 0.0.0.0
+ fi
;;
reload)
echo $arg1 > /proc/sys/net/core/net_alias_max