PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Parrot OS Int IP Address Resolution

Go down

Parrot OS Int IP Address Resolution Empty Parrot OS Int IP Address Resolution

Post by jamied_uk 25th June 2017, 13:11

vid


Code:
sudo leafpad .bashrc




Code:
function show_ip(){
echo -en "\e[92mYour IP's: \c"
echo ""
echo -n "Your Internal IP Is "
ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1
echo -n "Your External IP Is "
dig +short myip.opendns.com @resolver1.opendns.com
}

After restarting terminal window,


you can type


Code:
show_ip


You can change to eth1 or w.e adapter you need, eth0 is just the most common.
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Parrot OS Int IP Address Resolution Empty Re: Parrot OS Int IP Address Resolution

Post by jamied_uk 25th June 2017, 13:20

To make talking functionality you can use the following:


Code:
function log_last_ip(){
echo -en "\e[92mYour IP's: \c"
echo ""
echo -n "Your Internal IP Is "
ifconfig eth0 | grep "inet addr"| sed 's/addr:/ /' | awk '{print $2}'
echo -n "Your External IP Is "
dig +short myip.opendns.com @resolver1.opendns.com
}



Code:
function show_ip(){
# ip link show
a=$(md5deep -q last_ip.txt)
echo -en "\e[92mYour IP's: \c"
echo ""
echo -n "Your Internal IP Is "
ifconfig eth0 | grep "inet addr"| sed 's/addr:/ /' | awk '{print $2}'
echo -n "Your External IP Is "
dig +short myip.opendns.com @resolver1.opendns.com
log_last_ip > last_ip.txt
#md5sum last_ip.txt > last_ip_hash.txt
b=$(md5deep -q last_ip.txt)
[ "$a" = "$b" ] && echo  "IP Not Changed" > out.txt || echo "IP Has Changed Since Last Checked!" > out.txt
# cat out.txt
cat out.txt
espeak -v  en -f out.txt -g 01ms -a 110 -p 58 -s 175
}
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum