1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00
This commit is contained in:
OniriCorpe 2023-12-27 06:29:51 +01:00
parent ce7daa396a
commit 58a0d7594e

View file

@ -12,14 +12,14 @@ is_public_ip(){
local IP
IP="$1"
if [[ "$IP" =~ ^10.*|^169.*|^172.*|^192.168.* ]] ; then
# private ipv4
returns false
# private ipv4, so false
return 1
elif [[ "$IP" =~ ^fc*|^fd*|^fe80:* ]] ; then
# private ipv6
returns false
# private ipv6, so false
return 1
else
# public ip
returns true
# public ip, so true
return 0
fi
}