initscripts/etc/sysconfig/network-devices/ifup-routes

16 lines
353 B
Plaintext
Raw Normal View History

2011-04-26 12:26:24 +02:00
#!/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