initscripts/etc/sysconfig/network-scripts/ifup-routes
silvan bf8757b8e2 - modify network into RedHat style to work with NetworkManager ifcfg-rh plugin:
* use /etc/sysconfig/network-scripts instead of /etc/sysconfig/network-devices
   * use ifcfg-* interface configuration files instead of ifconfig.*
2011-04-27 19:48:38 +02:00

16 lines
353 B
Bash

#!/bin/sh
# adds static routes which go through device $1
DEVICE="$1"
if [ -z "${DEVICE}" ]; then
echo $"usage: ifup-routes <net-device>"
exit 1
fi
[ -r /etc/sysconfig/static-routes ] || exit 0
grep -v "^#\|^[ \t]*$" /etc/sysconfig/static-routes | while read dev args; do
[ "$dev" = "${DEVICE}" ] && /sbin/route add ${args} dev ${dev}
done