• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getting my IP on OS x
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting my IP on OS x


  • Subject: Re: getting my IP on OS x
  • From: Matthew Smith <email@hidden>
  • Date: Mon, 17 Jun 2002 17:19:16 +1000

on 17/06/2002 16:01, garrett at email@hidden wrote:

> is there a do shell script command to get my ip?


What about:

do shell script "/sbin/ifconfig en0 | grep inet"

This should return a line like:

inet 10.0.1.203 netmask 0xffffff00 broadcast 10.0.1.255

The IP address is after the "inet".

If you change en0 to en1 you will get the details for the Airport interface
instead of ethernet. If you want the ip address for dialup then use ppp0
instead.

--
Matthew Smith
_______________________________________________
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.

References: 
 >getting my IP on OS x (From: garrett <email@hidden>)

  • Prev by Date: Re: getting my IP on OS x
  • Next by Date: Re: getting my IP on OS x
  • Previous by thread: Re: getting my IP on OS x
  • Next by thread: just started..
  • Index(es):
    • Date
    • Thread