Fix bin/myip
Referring old functions that don't exist anymore.
This commit is contained in:
parent
7ccde092c4
commit
527d294dea
4
bin/myip
4
bin/myip
|
@ -10,9 +10,9 @@ if [[ -n $wan ]]; then
|
||||||
dig +short myip.opendns.com @resolver1.opendns.com
|
dig +short myip.opendns.com @resolver1.opendns.com
|
||||||
else
|
else
|
||||||
IF=$(netstat -rn | awk '/^0.0.0.0/ {thif=substr($0,74,10); print thif;} /^default.*UG/ {thif=substr($0,65,10); print thif;}')
|
IF=$(netstat -rn | awk '/^0.0.0.0/ {thif=substr($0,74,10); print thif;} /^default.*UG/ {thif=substr($0,65,10); print thif;}')
|
||||||
if _is_callable ifconfig; then
|
if command -v ifconfig >/dev/null; then
|
||||||
ifconfig ${NET_IF} | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
|
ifconfig ${NET_IF} | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
|
||||||
elif _is_callable ip; then
|
elif command -v ip >/dev/null; then
|
||||||
ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'
|
ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'
|
||||||
else
|
else
|
||||||
>&2 echo "No easy way to grab your IP"
|
>&2 echo "No easy way to grab your IP"
|
||||||
|
|
Loading…
Reference in a new issue