#!/bin/sh
#
#	$Id: ifup-routes,v 1.8 2000/04/21 17:47:49 jajcus Exp $
#
# adds static routes which go through device $DEVICE

if [ "$1" = "" ]; then
	echo "usage: $0 <net-device>"
	exit 1
fi

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

cd /etc/sysconfig/network-scripts
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network-scripts/.functions
CONFIG=$1
source_config

get_ppp_device_and_pid

# note the trailing white space character in the grep gets rid of aliases
grep "^$DEVICE[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
	/sbin/ip route add $args dev $REALDEVICE
done

