* fix illegal IPs from 224.0.0.0/8 range

This commit is contained in:
Dominika Liberda 2022-01-12 23:32:32 +00:00
parent 51c4051885
commit 8912e0f850

View file

@ -4,7 +4,7 @@
function random_ip() {
# basing on https://en.wikipedia.org/wiki/Reserved_IP_addresses
first=$(echo "$(shuf -i 128-224 -n1; shuf -i 11-126 -n1; shuf -i 1-9 -n1)" | shuf | tail -n1)
first=$(echo "$(shuf -i 128-223 -n1; shuf -i 11-126 -n1; shuf -i 1-9 -n1)" | shuf | tail -n1)
if [[ $first == 100 ]]; then
second=$(echo "$(shuf -i 0-63 -n1; shuf -i 128-254 -n1)" | shuf | tail -n1)