#!/bin/busybox sh
#
#	$Id: ifup-routes 10251 2009-03-26 13:04:12Z 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
	case "$args" in
	*:*)
		if is_no "$IPV6_NETWORKING"; then
			continue
		fi
		;;
	*)
		if is_no "$IPV4_NETWORKING"; then
			continue
		fi
		;;
	esac
	/sbin/ip route add $args dev $REALDEVICE
done
