Revision 2573,
1.1 KB
checked in by daisuke, 14 years ago
(diff) |
fix bash3ism
- bash4's source (or .) command does not search current directory any longer.
|
Rev | Line | |
---|
[1108] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | # removes aliases of device $1 |
---|
| 4 | |
---|
| 5 | device=$1 |
---|
| 6 | if [ "$device" = "" ]; then |
---|
| 7 | echo $"usage: $0 <net-device>" |
---|
| 8 | exit 1 |
---|
| 9 | fi |
---|
| 10 | |
---|
| 11 | parent_device=$device |
---|
| 12 | |
---|
| 13 | cd /etc/sysconfig/network-scripts |
---|
[2573] | 14 | . /etc/sysconfig/network-scripts/network-functions |
---|
[1108] | 15 | |
---|
| 16 | # This is the same messy sed script as in the ifup-aliases script. |
---|
| 17 | eval `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 | |
---|
| 19 | for DEVNUM in $rdev_LIST ; do |
---|
| 20 | ifconfig $parent_device:$DEVNUM down |
---|
| 21 | do_netreport=yes |
---|
| 22 | done |
---|
| 23 | |
---|
| 24 | # notify programs that have requested notification, if we changed anything |
---|
| 25 | if [ -n "$do_netreport" ]; then |
---|
| 26 | do_netreport |
---|
| 27 | fi |
---|
| 28 | |
---|
| 29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.