Linux Bash Function To Show Int & Ext IPs

View previous topic View next topic Go down

Linux Bash Function To Show Int & Ext IPs

Post by jamied_uk on 21st April 2016, 16:08

File https://app.box.com/s/cx77cvrdk90ae5nzk8meq8yf9bkj9lku




Code:
function show_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
}
avatar
jamied_uk
Admin

Posts : 2278
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


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