• 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: Get the IP Address of a Mounted Disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get the IP Address of a Mounted Disk


  • Subject: Re: Get the IP Address of a Mounted Disk
  • From: Martin Orpen <email@hidden>
  • Date: Fri, 15 Jul 2005 00:13:31 +0100

on 7/7/05 20:00, Eric Geoffroy at email@hidden wrote:

> netstat -f inet -W | awk '{print $5}

That awk line allowed me to use Spotlight to locate a little workaround that
I was messing about with a few months back:


--getIPAddress a hack to get the IP address of a mounted server
--the shell script:
--netstat -p tcp | awk '/afp/ { print $5 }'
--is much quicker, but not specific enough
--if you have multiple afp connections.

set a to choose folder --choose a server volume
tell application "Finder"
    set b to make alias to a
    set b to b as alias
end tell
set C to POSIX path of b
set C to C & "/rsrc"
set d to do shell script "strings " & quoted form of C
set e to paragraph 6 of d
tell application "Finder"
    move b to trash
end tell
e


Apologies for posting something that I can't test it at the moment - but
ISTR that it worked OK once upon a time. It may offer the OP an alternative
method of getting the IP if they don't like resorting to "do shell script"
as the alias contains a lot of useful information that I couldn't get using
vanilla AS.

--
Martin Orpen


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Get the IP Address of a Mounted Disk (From: Eric Geoffroy <email@hidden>)

  • Prev by Date: Re: Distiller Question
  • Next by Date: Unique ID of a Remote Computer
  • Previous by thread: Re: Get the IP Address of a Mounted Disk
  • Next by thread: Coercion problem
  • Index(es):
    • Date
    • Thread