added ips

master
David Kebler 2024-05-25 13:38:46 -07:00
parent 85fee64761
commit ca6f831c5d
2 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,7 @@ unlocku () ( faillock --user $1 --reset )
rsynchg() { rsync --help | grep "\-$1"; }
#get ip from domain name from internet
gip () {
if which jq &> /dev/null; then
curl -s "https://dns.google/resolve?name=$1" | jq -r '.Answer[] | .data' 2>/dev/null | tail -n 1
@ -67,6 +68,7 @@ gip () {
fi
}
# get public ip
gpip () {
curl https://ipv4.nsupdate.info/myip
}
@ -82,6 +84,7 @@ valid_ipv4() {
return 0
}
# get local ip using drill
dip () {
local ip4
ip4=$(/bin/drill $1 | grep -A1 'ANSWER SECTION' | grep -v "ANSWER SECTION" | rev | cut -f1 | rev)

View File

@ -74,5 +74,6 @@ fi
alias portl="ss -tunl | grep"
alias ipg="ip addr show | grep -A1 "
alias ips="ip addr show"
alias pubip="curl https://ipv4.nsupdate.info/myip; echo"