diff options
author | tv <tv@xso> | 2011-08-13 16:21:37 +0200 |
---|---|---|
committer | tv <tv@xso> | 2011-08-13 16:21:37 +0200 |
commit | 9b227b76ec6d6adabe33aa8c5857da79586ca07f (patch) | |
tree | 313ebb61749dd01d7a5db384ad44971359ec63b7 /retiolum/scripts/tinc_setup | |
parent | 965582580b83740435bfd8058bad5a85cfbc0db1 (diff) | |
parent | 6ed646ab7a7c6eb56afad481616d50805a6925ef (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-x | retiolum/scripts/tinc_setup/install.sh | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index 0902d417..526dbe1f 100755 --- a/retiolum/scripts/tinc_setup/install.sh +++ b/retiolum/scripts/tinc_setup/install.sh @@ -1,6 +1,6 @@ #! /bin/sh # USE WITH GREAT CAUTION -set -euf +set -eu if test "${nosudo-false}" != true -a `id -u` != 0; then echo "we're going sudo..." >&2 @@ -12,7 +12,7 @@ fi set -e DIRNAME=`dirname $0` CURR=`readlink -f ${DIRNAME}` -MYBIN=../../bin +MYBIN=${CURR}/../../bin netname=retiolum # create configuration directory for $netname mkdir -p /etc/tinc/$netname/hosts @@ -37,18 +37,13 @@ then then echo "select v4 subnet ip (1-255) :" read v4num - myipv4=10.7.7.$v4num - if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; - then - echo "check" - else - echo "you are made of stupid. bailing out" + if ! $MYBIN/check-free-retiolum-v4 $v4num;then exit 1 fi fi echo "Subnet = $myipv4" > hosts/$myname - myipv6=`${CURR}/../../bin/fillxx 42:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`/128 + myipv6=`$MYBIN/fillxx 42:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`/128 echo "Subnet = $myipv6" >> hosts/$myname else echo "own host file already exists! will not write again!" |