Parrot OS Int IP Address Resolution

View previous topic View next topic Go down

Parrot OS Int IP Address Resolution

Post by jamied_uk on 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.
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Parrot OS Int IP Address Resolution

Post by jamied_uk on 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
}
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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