Re: How do I get the IP address of an interface via applescript?
Re: How do I get the IP address of an interface via applescript?
- Subject: Re: How do I get the IP address of an interface via applescript?
- From: Peter Schwenk <email@hidden>
- Date: Mon, 13 Oct 2003 10:40:56 -0400
John:
Thanks for the info. I wasn't aware of the 'ipconfig' command, so I
finally decided to whip out the 'ol 'awk' and do this:
/sbin/ifconfig en0 inet | /usr/bin/grep inet | /usr/bin/awk -F' '
'{print $2}'
On Monday, October 13, 2003, at 10:17 AM, John C. Welch wrote:
The simplest way is a do shell script with ipconfig:
/usr/sbin/ipconfig getifaddr <interfacename>, so:
do shell script "/usr/sbin/ipconfig getifaddr en0" for the built in
Ethernet
port. It will return the ipaddress for that interface as a text string.
john
--
- Peter A. Schwenk | Mathematical Sciences
- email@hidden | University of Delaware
- (302) 831-0437 | Newark, DE 19716-2553 USA
_______________________________________________
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.