Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Run a script based on network / DHCP changes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Run a script based on network / DHCP changes
Authored by: sapporo on Sep 29, '04 02:20:20PM
Instead of modifying set-hostname, I guess you could also add the following to /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/Kicker.xml:


	<dict>
		<key>execCommand</key>
		<string>/usr/local/bin/networkchange</string>
		<key>execUID</key>
		<integer>0</integer>
		<key>keys</key>
		<array>
			<string>Setup:/Network/HostNames</string>
			<string>State:/Network/Global/DNS</string>
		</array>
		<key>name</key>
		<string>networkchange</string>
	</dict>


[ Reply to This | # ]
Run a script based on network / DHCP changes
Authored by: avengerpenguin on Sep 29, '04 06:07:57PM

That's pretty neat - do you have an URL which lists all the keys which may trigger a change for Kicker?



[ Reply to This | # ]
Run a script based on network / DHCP changes
Authored by: sapporo on Sep 30, '04 06:20:12AM
Unfortunately not, but since Kicker is open source, someone should be able to figure it out.

[ Reply to This | # ]
Run a script based on network / DHCP changes
Authored by: unixgeek on Oct 01, '04 11:53:52PM

This hint is exactly what I have been looking for. This is excellent information.

Is anyone able to expand the keys node? I recognize that the values are keys from configd, but in once case here it is State: rather than Setup:. I found another example on the net similar to this one on it used slightly different keys.

It would really be great if someone could explain the keys node.

Thanks!



[ Reply to This | # ]
Run a script based on network / DHCP changes
Authored by: tickell on Apr 29, '05 12:20:52PM

Just an "I learned it the hard way" item:

When you update the Kicker.xml file to reflect the addition of your new script, you must kill the configd process, and restart it. (A reboot will do this for you, but there is no need to waste the time)

If you're new script exits with a non-zero status at any point, it appears configd/Kicker will not use it for future state changes. So, if you had a typo or some other issue with it, repeat the restart process after you change it.

Regards



[ Reply to This | # ]