README FOR updateByHostPrefs ---------------------------- updateByHostPrefs is a login hook for Mac OS X that renames files in a user's Library/Preferences/ByHost/ folder with the MAC address of the host being logged into. It's useful when initially setting up a user's account, as you can create the user template home directory with default preference files containing a placeholder in the filename, and they will dynamically be renamed according to the host(s) used by a user. INSTALLATION ------------ In the Makefile, set INST_ROOT to wherever you want the software installed. Then run "make install". You can then set up the login hook. Edit the "console" line in /etc/ttys to look like this: console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LoginHook /usr/local/bin/updateByHostPrefs" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600" Then send a SIGHUP to init: sudo kill -1 1 USE --- If you use this as a login hook, follow the instructions above and you're set. Alternatively, you can run it from the command line, giving the username of the user you wish to affect as an argument: sudo updateByHostPrefs username You could run it for all users on a system with something like this (in tcsh): % foreach user (`ls -d /Users/[a-z]* | cut -d"/" -f3`) foreach? sudo updateByHostPrefs $user foreach? end PLATFORMS --------- updateByHostPrefs has been tested on the following platforms: - Mac OS X - versions 10.2.x CHANGES ------- You're not required by the license to submit changes back to the source, but I'd appreciate enhancements of general applicability. You can email new versions or contextual diffs ("diff -c old_file new_file") to . Some things to keep in mind if you do this: - Formatting - I use tabs for indentation, and sometimes to align code segments for readability. Please do the same. - Please don't use NotePad or some other Windows editor to make changes. Or if you do, get rid of the DOS linefeeds before submitting changes. - Please try to follow the formatting conventions established in the existing code. - Readability - Usually, I will trade off efficiency (of running time or of development time) in favor of readability. - Insert meaningful comments where appropriate. CONTRIBUTORS ------------ Leon Towns-von Stauber Ryan Schwartz (v2, Mar 2003) Meg Faddick, Brian Tobia (pointed out problems leading to v3/v4, Jul-Aug 2003) Enjoy! Copyright (c) 2002-2003. All rights reserved. See the LICENSE file distributed with this code for restrictions on its use and further distribution. Original distribution available at .