File: nonlocalip.func

package info (click to toggle)
giarpfanoa 0.1.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 224 kB
  • ctags: 7
  • sloc: makefile: 81; sh: 58
file content (20 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Argument: ip[s]
nonlocalip() {
    # Not local IP:s. For dig, whois etc.
    RET=""
    for I in $1 ; do
	if echo "$I" | $IFGREP "^192\.168\." ; then
	    true
	elif echo "$I" | $IFGREP "^127\.0\.0\." ; then
	    true
	elif echo "$I" | $IFGREP "^10\." ; then
	    true
	else
	    if [ -z "$RET" ] ; then
		RET=$I
	    else
		RET="$RET $I"
	    fi
	fi
    done
}