From: Nicolas Boisselier Date: Thu, 27 Jun 2019 02:46:03 +0000 (+0100) Subject: etc/profile.d/functions X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=aa1779a887489e1c849db74f7e27eb7522fe5101;p=nb.git etc/profile.d/functions --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index d8978fc2..0e0052fa 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -932,3 +932,14 @@ cron_d_install() { [ "$cron" != "$(crontab -l)" ] && echo "$cron" | crontab } + +ip_is_local() { + case "$1" in + 10.*) return 0 ;; + 172.16.*) return 0 ;; + 172.2[0-9].*) return 0 ;; + 172.31.*) return 0 ;; + 192.168.*) return 0 ;; + esac + return 1 +}