diff options
author | Lassulus <lassulus@googlemail.com> | 2012-12-27 23:08:20 +0100 |
---|---|---|
committer | Lassulus <lassulus@googlemail.com> | 2012-12-27 23:08:20 +0100 |
commit | 0080bb1059ad5402500c747d56c19a175604ddda (patch) | |
tree | caf0e3126da8cf82d915ff6251063dbda5150a8b /retiolum | |
parent | 1fcbb7ddbdaa598c9efee2d33f759b17d90762ca (diff) |
fixed hostmask generation
Diffstat (limited to 'retiolum')
-rwxr-xr-x | retiolum/scripts/tinc_setup/new_install.sh | 2 |
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="" |