Re: Change DHCP Client ID
Re: Change DHCP Client ID
- Subject: Re: Change DHCP Client ID
- From: "Alatorre, Michael" <email@hidden>
- Date: Wed, 19 Dec 2001 14:31:29 -0800
On Wed, 19 Dec 2001 11:52:56 +1100, Shane Stanley so kindly responded with:
>
Go to <http://www.apple.com/applescript/help_mods.html> and download the
>
Open Transport module. It should have all you need to get started.
By downloading this help mod (and looking the Guidebook Module
NWK0150:Module Content:AppleScript Guidebook:netwk:scr: folder), referencing
the sample scripts with the dictionary in question, it pointed me in another
direction. I could accomplish the same thing by deactivating/activating the
IP stack:
-- An AppleScript for a DHCP release & renew by closing then opening the IP
stack
-- close IP stack
try
-- create a variable to store the transaction ID
set the transaction_ID to ""
tell application "Network Setup Scripting"
open database -- open the Networking Database
set the transaction_ID to begin transaction -- begin a transaction
tell TCPIP v4 options to set TCPIP active to false -- TCP/IP to
inactive
end transaction -- close the current transaction
close database --close the Network Database
end tell
on error error_message
try
tell application "Network Setup Scripting"
-- Abort the current transaction. Any changes will be
discarded
if the transaction_ID is not "" then abort transaction
-- try to close the database if it was left open
close database
end tell
end try
end try
-- open IP stack
try
-- create a variable to store the transaction ID
set the transaction_ID to ""
tell application "Network Setup Scripting"
open database -- open the Networking Database
set the transaction_ID to begin transaction -- begin a transaction
tell TCPIP v4 options to set TCPIP active to true -- TCP/IP to
active
end transaction -- close the current transaction
close database --close the Network Database
end tell
on error error_message
try
tell application "Network Setup Scripting"
-- Abort the current transaction. Any changes will be
discarded
if the transaction_ID is not "" then abort transaction
-- try to close the database if it was left open
close database
end tell
end try
end try
This works for us. If anyone sees a cleaner method, I'm all ears. Thank you
Shane, and the list.
Michael Alatorre (
mailto:email@hidden)
EIS Liaison Analyst
Cedars-Sinai Health System (
http://www.cedars-sinai.edu/)
Medical Affairs: 310.423.6237 310.423.0448 (fax)
"A good teacher is one who can understand those who are not very good at
explaining, and explain to those who are not very good at understanding." --
Dwight Eisenhower