.
This commit is contained in:
11
shared/myshared
Normal file → Executable file
11
shared/myshared
Normal file → Executable file
@ -15,10 +15,13 @@ set_constants () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_myip () {
|
get_myip () {
|
||||||
# dig not installed on alpine
|
#
|
||||||
#MYEXTERNALIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
# dig not installed on alpine
|
||||||
#MYEXTERNALIP=$(curl checkip.dyndns.org| awk -F'<' '{print $7 }'| awk -F' ' '{ print $4 }')
|
#
|
||||||
MYEXTERNALIP=$(curl ipinfo.io/ip)
|
# MYEXTERNALIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
||||||
|
# MYEXTERNALIP=$(curl checkip.dyndns.org| awk -F'<' '{print $7 }'| awk -F' ' '{ print $4 }')
|
||||||
|
# MYEXTERNALIP=$(curl ipinfo.io/ip)
|
||||||
|
MYEXTERNALIP=$(curl checkip.amazonaws.com)
|
||||||
MYFULLIP=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
|
MYFULLIP=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
|
||||||
MYNETWORK=$(echo ${MYFULLIP}| cut -f1-3 -d.)
|
MYNETWORK=$(echo ${MYFULLIP}| cut -f1-3 -d.)
|
||||||
MYIP=$(echo ${MYFULLIP}| cut -f4 -d.)
|
MYIP=$(echo ${MYFULLIP}| cut -f4 -d.)
|
||||||
|
|||||||
Reference in New Issue
Block a user