IPfinder Bash Script. 08-26-2014, 02:53 PM
#1
Hello HackCommunity, I have a little bash script here that I am using long time now. I thought is worth sharing this. Its a script that will find and nicely print out your local && global ip address.Again this is mainly for terminal users. Ofc you can find them manually on terminal && on browser, but this for sure save you time and I guess you will find it more handy too.
Requirements : Linux OS
Here is the code:
Running this script will conclude on this results normally:
I wish this script will help Linux Buddies in any way!
Thanks a lot for reading this.
Sincerely,
L0aD1nG
EDIT : Thanks to @Singularity for his important note!
Requirements : Linux OS
Here is the code:
Code:
#!/bin/bash
## Setting up the variables for check up
eth_info=`ifconfig eth0 | grep "inet addr" | awk -F: ' { print $2 } ' | awk ' { print $1 } '`
wlan_info=`ifconfig wlan0 | grep "inet addr" | awk -F: ' { print $2 } ' | awk ' { print $1 } '`
## Prints your local ip address
echo -e "\nYour Local Ip Is : \c"
if [ -z $eth_info ];
then
echo $wlan_info
else
echo $eth_info
fi
echo
## Prints your local Ip address
echo -e "Your Global Ip Is : \c"
wget http://ipecho.net/plain -O - -q ; echo
echoRunning this script will conclude on this results normally:
Quote:Your Local Ip Is : <local ip address>
Your Global Ip Is : <global ip address>
I wish this script will help Linux Buddies in any way!
Thanks a lot for reading this.
Sincerely,
L0aD1nG
EDIT : Thanks to @Singularity for his important note!
(This post was last modified: 08-26-2014, 04:32 PM by krozz.)
MASTERING OTHERS IS STRENGTH, MASTERING YOURSELF IS TRUE POWER.
![[Image: qJweLN6.jpg]](http://i.imgur.com/qJweLN6.jpg)


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)
![[Image: obDhRdK.gif]](http://i.imgur.com/obDhRdK.gif)
