if [ "$1" = "" ]; then
	echo "Usage: ./setMetric <routeIndex> <Metric>"
	exit
fi


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

PREV_INDEX=`expr $1 - 1`

echo "/	METRIC\[$PREV_INDEX\]/ a \	METRIC[$1]=\"$2\"" > /tmp/metricadd 
sed -i -f /tmp/metricadd /nn/etc/ppp/ip_up_add_m50
rm -f /tmp/metricadd
