Revision 1108,
651 bytes
checked in by daisuke, 14 years ago
(diff) |
import initscripts-8.90.6 from internal cvs repository
|
Rev | Line | |
---|
[1108] | 1 | #! /bin/bash |
---|
| 2 | # |
---|
| 3 | # Drops static routes which go through device $1 |
---|
| 4 | if [ -z "$1" ]; then |
---|
| 5 | echo $"usage: ifup-routes <net-device> [<nickname>]" |
---|
| 6 | exit 1 |
---|
| 7 | fi |
---|
| 8 | |
---|
| 9 | # The routes are actually dropped just by setting the link down, so nothing |
---|
| 10 | # needs to be done |
---|
| 11 | |
---|
| 12 | MATCH='^[[:space:]]*(\#.*)?$' |
---|
| 13 | |
---|
| 14 | # Routing rules |
---|
| 15 | FILES="/etc/sysconfig/network-scripts/rule-$1" |
---|
| 16 | if [ -n "$2" -a "$2" != "$1" ]; then |
---|
| 17 | FILES="$FILES /etc/sysconfig/network-scripts/rule-$2" |
---|
| 18 | fi |
---|
| 19 | |
---|
| 20 | for file in $FILES; do |
---|
| 21 | if [ -f "$file" ]; then |
---|
| 22 | { cat "$file" ; echo ; } | while read line; do |
---|
| 23 | if [[ ! "$line" =~ $MATCH ]]; then |
---|
| 24 | /sbin/ip rule del $line |
---|
| 25 | fi |
---|
| 26 | done |
---|
| 27 | fi |
---|
| 28 | done |
---|
Note: See
TracBrowser
for help on using the repository browser.