From 056f7ad405dc6e1d9e59a185bdb5378627e6acbd Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 24 Dec 2011 13:58:58 +0100 Subject: now with multiple ip support --- retiolum/scripts/routing/defaultroute.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/retiolum/scripts/routing/defaultroute.sh b/retiolum/scripts/routing/defaultroute.sh index 0cb142d0..9d7d6683 100755 --- a/retiolum/scripts/routing/defaultroute.sh +++ b/retiolum/scripts/routing/defaultroute.sh @@ -30,8 +30,17 @@ case "$1" in exit 1;; esac + cat $tincdir/hosts/* | grep Address | cut -b 11- | while read host do - route $command $host gw $defaultroute + if [ "$(echo $host | sed 's/[0-9]*//g' | sed 's/>//g')" = '' ]; then + route $command $host gw $defaultroute + else + host -4 $host | grep "has address" | awk '{ print $4 }' | + while read addr + do + route $command $addr gw $defaultroute + done + fi done -- cgit v1.2.3