diff options
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-x | retiolum/scripts/tinc_setup/new_install.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index bbf4475e..45316796 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -61,7 +61,7 @@ host2subnet() result=$(($(($((1 << $1)) - 1)) << $((32 - $1)))) byte="" - for ((i=0;i<3;i+=1)); do + for i in {0..2}; do byte=.$(($result % 256))$byte result=$(($result / 256)) done @@ -151,11 +151,26 @@ if ! which awk&>/dev/null; then exit 1 fi -if ! which curl&>/dev/null; then - echo "Please install curl" +if ! which hostname&>/dev/null; then + echo "Please install hostname" exit 1 fi +if ! which openssl&>/dev/null; then + echo "Please install openssl" + exit 1 +fi + +if ! which curl&>/dev/null; then + if ! which wget&>/dev/null; then + echo "Please install curl or wget" + exit 1 + else + LOADER='wget -O-' +else + LOADER=curl +fi + if ! $(/bin/ping -c 1 euer.krebsco.de -W 5 &>/dev/null) ;then echo "Cant reach euer, check if your internet is working" exit 1 @@ -232,7 +247,7 @@ fi #get tinc-hostfiles mkdir -p $TEMPDIR/hosts -curl euer.krebsco.de/retiolum/hosts.tar.gz | tar zx -C $TEMPDIR/hosts/ +$LOADER euer.krebsco.de/retiolum/hosts.tar.gz | tar zx -C $TEMPDIR/hosts/ #check for free ip #version 4 |