Re: Get IP Address
Re: Get IP Address
- Subject: Re: Get IP Address
- From: Conaire Mullins <email@hidden>
- Date: Tue, 21 Oct 2003 19:51:06 -0400
On Tuesday, October 21, 2003, at 06:06 PM, Steve Mills wrote:
On Tuesday, Oct 21, 2003, at 15:51 US/Central, Ian Ferguson wrote:
If you were behind a router, this may not work. An address such as
192.168.0.XXX could be returned and not a true external IP address.
I also think that you could sum this up on one line.
display dialog "IP:" default answer (do shell script "ifconfig en0 |
grep 'inet' | awk '{print $2}'")
Nope, that gets:
fe80::20a:95ff:fec4:5ae6%en0
192.168.1.4
'ifconfig en0' doesn't even list the WAN address, not for me any way.
I use this to get my public IP address from behind a router
set ip_external to characters 1 thru -2 of (words 31 thru 32 of ,
((do shell script "curl
http://checkip.dyndns.org/") as international
text) as text) as text
display dialog "Public IP" & ip_external
-----
Conaire Mullins
Programmer: Red eyed mumbling mammal, capable of communicating with
inanimate objects.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.