source: projects/initscripts/tags/initscripts-8.91.0/sysconfig/network-scripts/ifdown-aliases @ 2576

Revision 2576, 1.1 KB checked in by daisuke, 13 years ago (diff)

tagging as initscripts-8.91.0

Line 
1#!/bin/bash
2
3# removes aliases of device $1
4
5device=$1
6if [ "$device" = "" ]; then
7       echo $"usage: $0 <net-device>"
8       exit 1
9fi
10
11parent_device=$device
12
13cd /etc/sysconfig/network-scripts
14. /etc/sysconfig/network-scripts/network-functions
15
16# This is the same messy sed script as in the ifup-aliases script.
17eval `LC_ALL= LANG= 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;
18
19for DEVNUM in $rdev_LIST ; do
20       ifconfig $parent_device:$DEVNUM down
21       do_netreport=yes
22done
23
24# notify programs that have requested notification, if we changed anything
25if [ -n "$do_netreport" ]; then
26       do_netreport
27fi
28
29
Note: See TracBrowser for help on using the repository browser.