D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] bash shell script question

 

Can we extend that, so that it tells me what IP address my network is showing to the outside world? I tend to typ My IP address into Google when I want to check, but is something better automatable?


On Fri Jan 02 2015 at 18:35:43 bad apple <mr.meowski@xxxxxxxx> wrote:
On 02/01/15 18:10, Gordon Henderson wrote:
> On Fri, 2 Jan 2015, Martijn Grooten wrote:

Just another "I do it like this" post. hostname can return too much
information whereas this will *usually* get what you want:

ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'

Obviously still not perfect but usually how I script it.


--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq