blockcheck: port and ip block tests

This commit is contained in:
bol-van
2024-06-20 11:54:03 +03:00
parent 8a4eb6fc8f
commit efc13032a1
2 changed files with 183 additions and 34 deletions

View File

@@ -293,7 +293,7 @@ random()
rs="$RANDOM$RANDOM$(date)"
fi
# shells use signed int64
r=1$(echo $rs | $MD5 | sed 's/[^0-9]//g' | head -c 17)
r=1$(echo $rs | $MD5 | sed 's/[^0-9]//g' | cut -c 1-17)
echo $(( ($r % ($2-$1+1)) + $1 ))
}