From 0080bb1059ad5402500c747d56c19a175604ddda Mon Sep 17 00:00:00 2001 From: Lassulus Date: Thu, 27 Dec 2012 23:08:20 +0100 Subject: fixed hostmask generation --- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 41a1f73a..3f904871 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -58,7 +58,7 @@ EOF #convert hostmask to subnetmask only version 4 host2subnet() { - NEEDDOTSINSUB=$(expr 3 - $(echo $SUBNET4 | sed 's/[0-9]*//g')) + NEEDDOTSINSUB=$(expr 3 - $( echo $SUBNET4 | tr -C -d . | wc -c)) FULLSUBNET=$(echo $SUBNET4$(eval "printf '.0'%.0s {1..${#NEEDDOTSINSUB}}"s)) result=$(($(($((1 << $1)) - 1)) << $((32 - $1)))) byte="" -- cgit v1.2.3