Diff for scripts/shell/firewall/firewall.d/subnets/simplify-subnets.sh between version 1.3 and 1.4
| version 1.3, 2018/05/07 23:52:34 |
version 1.4, 2018/05/08 00:00:30 |
|
|
| # 2018-05-07 - created |
# 2018-05-07 - created |
| # |
# |
| |
|
| # $Platon: scripts/shell/firewall/firewall.d/subnets/simplify-subnets.sh,v 1.2 2018/05/07 22:20:40 nepto Exp $ |
# $Platon: scripts/shell/firewall/firewall.d/subnets/simplify-subnets.sh,v 1.3 2018/05/07 23:52:34 nepto Exp $ |
| |
|
| |
# Minimum amount of C-classes to be merged into one B-class |
| |
MIN_C_CLASS_MERGE=120; |
| SUBNET_FILE="$1"; |
SUBNET_FILE="$1"; |
| |
|
| if [ -z "$SUBNET_FILE" ]; then |
if [ -z "$SUBNET_FILE" ]; then |
| Line 57 while IFS='' read -r line; do |
|
| Line 59 while IFS='' read -r line; do |
|
| continue; |
continue; |
| fi |
fi |
| |
|
| if [ "$cnt_CinB" -gt 128 ]; then |
if [ "$cnt_CinB" -gt "$MIN_C_CLASS_MERGE" ]; then |
| echo "# Merged $cnt_CinB C-classes to one B-class"; |
echo "# Merged $cnt_CinB C-classes into one B-class"; |
| echo "$prev_B/16"; |
echo "$prev_B/16"; |
| else if [ "$cnt_CinB" -eq 1 ]; then |
else if [ "$cnt_CinB" -eq 1 ]; then |
| if [[ "$to_write" = */24 ]]; then |
if [[ "$to_write" = */24 ]]; then |
Platon Group <platon@platon.org> http://platon.org/
|
|