#!/bin/sh
#
#	$Id: ifup-routes 10185 2009-03-09 21:12:19Z baggins $
#
# 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
grep -E "^($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
