diff options
| author | Lassulus <lassulus@googlemail.com> | 2012-12-10 01:58:30 +0100 | 
|---|---|---|
| committer | Lassulus <lassulus@googlemail.com> | 2012-12-10 01:58:30 +0100 | 
| commit | 8253b111a9d61ff9763bf6bf588c852a5a948c84 (patch) | |
| tree | c3eb95200152989ca438ffbbd9dc7c1dd95bda00 /retiolum/scripts | |
| parent | bce2e977ba603a3fa27d77827263a99d2913482e (diff) | |
added variable IPv6 length
Diffstat (limited to 'retiolum/scripts')
| -rwxr-xr-x | retiolum/scripts/tinc_setup/new_install.sh | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 275805a7..cc9746b5 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -263,7 +263,9 @@ done  #version 6  until check_ip_taken $IP6; do      if [ $RAND6 -eq 1 ]; then -        IP6="$SUBNET6$(head /dev/urandom | tr -dc "0123456789abcdef" | head -c28 | sed 's/..../:&/g')" #todo: generate ip length from hostmask +        NETLENGTH=$(expr $(expr 128 - $MASK6) / 4) +        echo $NETLENGTH +        IP6="$SUBNET6$(head /dev/urandom | tr -dc "0123456789abcdef" | head -c$NETLENGTH | sed 's/..../:&/g')" #todo: generate ip length from hostmask      else          printf 'ip taken, choose new ip: ' | 
