diff options
Diffstat (limited to 'retiolum/scripts/routing/defaultroute.sh')
-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 |