if [ "$1" = "" ]; then
	echo "Usage: ./setRoute <routeIndex> <destination Addr>"
	exit
fi

param1=`grep "^$2" /nn/etc/ppp/ip_up_add_m50`

if [ "$param1" = "" ]; then
	echo "Route does not Exist..";
else
	echo "Route Already exists... " ;
	exit
fi

param=`grep "^$2" /nn/etc/ppp/ip_up_add_m50`

if [ "$param" = "" ]; then
	echo "Valid Index";
else
	echo "Invalid Index.." ;
	exit
fi

# Adding a new Entry. Modifying existing one is not handled by this.


echo "/ROUTES\[$1\]/ c \	ROUTES[$1]=\"$2\"" > /tmp/routeadd_backslash 
sed -i -f /tmp/routeadd_backslash /nn/etc/ppp/ip_up_add_m50
rm -f /tmp/routeadd_backslash
