summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/tinc_setup
diff options
context:
space:
mode:
authorLassulus <lassulus@googlemail.com>2012-12-27 23:08:20 +0100
committerLassulus <lassulus@googlemail.com>2012-12-27 23:08:20 +0100
commit0080bb1059ad5402500c747d56c19a175604ddda (patch)
treecaf0e3126da8cf82d915ff6251063dbda5150a8b /retiolum/scripts/tinc_setup
parent1fcbb7ddbdaa598c9efee2d33f759b17d90762ca (diff)
fixed hostmask generation
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-xretiolum/scripts/tinc_setup/new_install.sh2
1 files changed, 1 insertions, 1 deletions
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=""