From: Nicolas Boisselier Date: Sat, 6 Jul 2019 01:25:07 +0000 (+0100) Subject: etc/profile.d/net.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9cdebd2ff85685d5d6155d5dddf6d3d0b3807034;p=nb.git etc/profile.d/net.sh --- diff --git a/etc/profile.d/net.sh b/etc/profile.d/net.sh index ec992af2..2b9ecbe1 100644 --- a/etc/profile.d/net.sh +++ b/etc/profile.d/net.sh @@ -59,8 +59,8 @@ net_mask2cdr() { echo $(( $2 + (${#x}/4) )) } -net_is_local() { - declare ip="${1:?Usage: net_is_local IP|HOST}" +net_is_private() { + declare ip="${1:?Usage: net_is_private IP|HOST}" case "$ip" in [0-9][0-9]?[0-9]?.[0-9][0-9]?[0-9]?.[0-9][0-9]?[0-9]?.[0-9][0-9]?[0-9]?) [ 1 ];; *) ip="$(net_host2ip "$ip")"