Re: IP Address
Re: IP Address
- Subject: Re: IP Address
- From: vectormation <email@hidden>
- Date: Thu, 8 Mar 2001 18:18:16 -0500
Problem with this is that (at least in my case) it does not
work for DHCP addresses - I always got "0.0.0.0"... YMMV
~Phi
>
AFAIK, Remote Access scripting is only helpful for people using PPP to
>
connect to the net.
>
>
It might be better to suggest using Network Setup Scripting as a generic
>
solution. I use the following script to get my current IP address:
>
>
log IPAddressFromNetworkSetup()
>
>
on IPAddressFromNetworkSetup()
>
set currentIP to ""
>
tell application "Network Setup Scripting"
>
try
>
try
>
open database
>
on error errmsg
>
if errmsg contains "already open" then
>
close database
>
open database
>
end if
>
end try
>
>
begin transaction
>
>
set thisConfig to the active tcpip configuration
>
set currentIP to IP address of TCPIP v4 configuration named
>
thisConfig
>
>
end transaction
>
>
close database
>
>
on error errmsg number ErrNum
>
abort transaction
>
close database
>
end try
>
return currentIP
>
end tell
>
end IPAddressFromNetworkSetup
>
>
HTH
>
>
JR