Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call Script When Network Interface Changes State

Status
Not open for further replies.

trmg

IS-IT--Management
Sep 23, 2007
178
US
Hey All,

I'm having trouble with time synchronization issues with some of my dual-boot Macs. It's not the normal UTC/Localtime issue that affects booting between Windows and OS X. It seems that the time often drifts just enough to break network logins (Active Directory).

So, what I want to do is write a script that runs under OS X and simply runs the commands:

systemsetup -setusingnetworktime off
systemsetup -setusingnetworktime on

when any network interface (wireless or wired) changes state to up.

We're running Leopard. What's the best way to approach this?
 
Oops...I should clarify:

"when any network interface (wireless or wired) changes state to up **and has obtained an IP address**."

Thanks!
 
Hi, how much drift we talking about? You could just write a cron job that will do the 2 commands you want to do every 5 mins or so.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top