added ips
parent
85fee64761
commit
ca6f831c5d
|
@ -57,6 +57,7 @@ unlocku () ( faillock --user $1 --reset )
|
||||||
rsynchg() { rsync --help | grep "\-$1"; }
|
rsynchg() { rsync --help | grep "\-$1"; }
|
||||||
|
|
||||||
|
|
||||||
|
#get ip from domain name from internet
|
||||||
gip () {
|
gip () {
|
||||||
if which jq &> /dev/null; then
|
if which jq &> /dev/null; then
|
||||||
curl -s "https://dns.google/resolve?name=$1" | jq -r '.Answer[] | .data' 2>/dev/null | tail -n 1
|
curl -s "https://dns.google/resolve?name=$1" | jq -r '.Answer[] | .data' 2>/dev/null | tail -n 1
|
||||||
|
@ -67,6 +68,7 @@ gip () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get public ip
|
||||||
gpip () {
|
gpip () {
|
||||||
curl https://ipv4.nsupdate.info/myip
|
curl https://ipv4.nsupdate.info/myip
|
||||||
}
|
}
|
||||||
|
@ -82,6 +84,7 @@ valid_ipv4() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get local ip using drill
|
||||||
dip () {
|
dip () {
|
||||||
local ip4
|
local ip4
|
||||||
ip4=$(/bin/drill $1 | grep -A1 'ANSWER SECTION' | grep -v "ANSWER SECTION" | rev | cut -f1 | rev)
|
ip4=$(/bin/drill $1 | grep -A1 'ANSWER SECTION' | grep -v "ANSWER SECTION" | rev | cut -f1 | rev)
|
||||||
|
|
|
@ -74,5 +74,6 @@ fi
|
||||||
alias portl="ss -tunl | grep"
|
alias portl="ss -tunl | grep"
|
||||||
|
|
||||||
alias ipg="ip addr show | grep -A1 "
|
alias ipg="ip addr show | grep -A1 "
|
||||||
|
alias ips="ip addr show"
|
||||||
|
|
||||||
alias pubip="curl https://ipv4.nsupdate.info/myip; echo"
|
alias pubip="curl https://ipv4.nsupdate.info/myip; echo"
|
Loading…
Reference in New Issue