RE: TCP/IP config change
RE: TCP/IP config change
- Subject: RE: TCP/IP config change
- From: email@hidden
- Date: Tue, 2 Jul 2002 05:32:29 EDT
Luis,
In the TCP/IP control panel, saving the settings as configurations
"ethernet" and "ppp" respectively. Then try using this script, which does not
require any third party AppleScript extenders (i.e. - no non-Apple OSAXEN
req'd):
-- does require "Network Setup Scripting", which ships with OS 9.x; I don't
know about if it ships with 8.5...
tell application "Network Setup Scripting"
set Turn_Off to "ethernet" -
set Currently_Off to {"ethernet"}
set Turn_On to "ppp"
set Currently_On to {"ppp"}
set transaction_ID to ""
try
open database
on error
close database
end try
try
if ((exists TCPIP v4 configuration the Turn_On) and (exists ,
TCPIP v4 configuration the Turn_Off)) then
--- grab the currently active config name
set the current_setting to the name of every TCPIP v4 ,
configuration whose active is true
if (current_setting = Currently_On) then
set transaction_ID to begin transaction
set active of TCPIP v4 configuration the Turn_Off to true
end transaction
set Our_Flag to "TCP/IP has been set to EtherNet."
else if (current_setting = Currently_Off) then
set transaction_ID to begin transaction
set active of TCPIP v4 configuration the Turn_On to true
end transaction
set Our_Flag to "TCP/IP has been set to PPP."
end if
else
set Our_Flag to "unabled to find the two required ,
configurations (ethernet & ppp) by name"
end if
close database
on error
try
if transaction_ID is not "" then
abort transaction
end if
close database
on error
close database
set Our_Flag to "No Changes Made due to Error with ,
updating the TCP/IP stacks."
end try
end try
end tell
tell application "Finder"
display dialog Our_Flag buttons {"OK"} default button ,
1 giving up after 29
end tell
_______________________________________________
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.