Blame | Last modification | View Log | RSS feed
#! /bin/bash## Drops static routes which go through device $1if [ -z "$1" ]; thenecho $"usage: ifup-routes <net-device> [<nickname>]"exit 1fi# The routes are actually dropped just by setting the link down, so nothing# needs to be doneMATCH='^[[:space:]]*(\#.*)?$'# Routing rulesFILES="/etc/sysconfig/network-scripts/rule-$1 /etc/sysconfig/network-scripts/rule6-$1"if [ -n "$2" -a "$2" != "$1" ]; thenFILES="$FILES /etc/sysconfig/network-scripts/rule-$2 /etc/sysconfig/network-scripts/rule6-$2"fifor file in $FILES; doif [ -f "$file" ]; thenproto=if [ "$file" != "${file##*/rule6-}" ]; thenproto="-6"fi{ cat "$file" ; echo ; } | while read line; doif [[ ! "$line" =~ $MATCH ]]; then/sbin/ip $proto rule del $linefidonefidone