#!/bin/sh
#
#	$Id: ifup-routes 8191 2007-01-22 18:47:33Z glen $
#
# Adds static routes which go through device $DEVICE
# Called from ifup-post.

if [ ! -f /etc/sysconfig/static-routes ]; then
	return
fi

# note the trailing white space character in the grep gets rid of aliases
egrep "^($DEVICE|any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
	if [[ "$args" = *:* ]]; then
		if is_no "$IPV6_NETWORKING"; then
			continue
		fi
	else
		if is_no "$IPV4_NETWORKING"; then
			continue
		fi
	fi
	/sbin/ip route add $args dev $REALDEVICE
done

# This must be last line !
# vi:syntax=sh
