diff options
author | lassulus <lassulus@googlemail.com> | 2011-12-24 13:58:58 +0100 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2011-12-24 13:58:58 +0100 |
commit | 056f7ad405dc6e1d9e59a185bdb5378627e6acbd (patch) | |
tree | bfa8f19c72285fdd223e2bbf7ac8228d40355e75 /retiolum/scripts/routing | |
parent | 58a3bf239f02960b1aa3a9d14c66de406252077d (diff) |
now with multiple ip support
Diffstat (limited to 'retiolum/scripts/routing')
-rwxr-xr-x | retiolum/scripts/routing/defaultroute.sh | 11 |
1 files changed, 10 insertions, 1 deletions
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 |