diff options
| author | EUcancER <root@euer.krebsco.de> | 2012-01-04 01:02:11 +0100 | 
|---|---|---|
| committer | EUcancER <root@euer.krebsco.de> | 2012-01-04 01:02:11 +0100 | 
| commit | 1b1b253786561e0070b9efae69101f1fee45a752 (patch) | |
| tree | 5c199f80028b5a32bb94858bb55c6d8e9d60978e /retiolum/scripts/routing | |
| parent | ecf910d71789d3c24dced047ff5326d12b810e45 (diff) | |
| parent | 0f5edb5dea18c4eb28d1fda4a106b868a23cc614 (diff) | |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/scripts/routing')
| -rwxr-xr-x | retiolum/scripts/routing/defaultroute.sh | 16 | 
1 files changed, 4 insertions, 12 deletions
| diff --git a/retiolum/scripts/routing/defaultroute.sh b/retiolum/scripts/routing/defaultroute.sh index b7d703e8..f5a1a465 100755 --- a/retiolum/scripts/routing/defaultroute.sh +++ b/retiolum/scripts/routing/defaultroute.sh @@ -7,7 +7,7 @@ usage()      echo "-d       deactivate routing"  } -defaultroute=$(route -n | grep 'UG[ \t]' | awk '{print $2}') +defaultroute=$(ip route show | grep default | awk '{ print $3 }')  tincdir="/etc/tinc/retiolum"  if [[ $(id -u) -gt 0 ]]; then @@ -30,17 +30,9 @@ case "$1" in          exit 1;;  esac - -cat $tincdir/hosts/* | grep Address | cut -b 11- | +cat $tincdir/tinc.conf | grep ConnectTo | cut -b 13- |  while read host  do -    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 && echo "$command routing to $addr via $defaultroute" -        done -    fi +    addr=$(cat $tincdir/hosts/$host | grep Address | cut -b 11-) +    echo route $command $addr gw $defaultroute  done | 
