16 lines
353 B
Bash
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
|