#!/bin/sh
#
# Mostra il default gateway

SCRIPT=`basename $0`

if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
	echo -e "\n$SCRIPT v 0.2 01/01/2009\n"
	echo -e "Parametri:"
	echo -e "  -h,  --help\tQuesto messaggio"
	echo -e "  -1\t\tSe ci sono piu' default gateway ne restituisce soltanto il primo"
	echo -e ""
	exit 0
fi

ONLYFIRST=""

if [ "$1" == "-1" ]; then
	ONLYFIRST="-m 1"
fi

route -n |grep $ONLYFIRST ^0.0.0.0 | tr -s ' ' | cut -d' ' -f2

exit 0
