Shell scripts for OS X
This script will attempt to change a user's short name in Mac OS X
For some reason, it is not easy to change the short name of a user in some earlier versions of Mac OS X using any kind of GUI or any straight-forward command-line utility. This script attempts to make possible the process of changing the user's short name, as well as all user attributes with the same name, any groups with this short name set as their name, and any groups that the user belongs to.
*Most of the work in the changeShortName script is done by the dscl instead of nicl to maintain forward compatibility (thanks Dawe!).
Create Desktop Folder Alias
Create a symbolic link from the invisible "Desktop Folder" on a computer's hard drive to the user's Desktop in Mac OS X. The desktop link will be named "Desktop (Mac OS 9)".
This script will remove the current user (the user who runs the script), thier home directory, and the ".AppleSetupDone" file (not necessarily in that order). This is useful for getting comptuers that were setup back to a restored condition (booting to the setup assistant). The script requires that an administrator account be used.
The "remove_user" script has tested successful on Mac O.S. X versions 10.3.5 and later. Earlier versions of Mac O.S. X behave differently with this script's execution. Particularly, on Mac O.S. 10.2.x, the script will not restart the computer automatically after execution, and the user must choose "Restart" from the "Apple" menu after the script reports failure on restarting. This happens after removing the current user's account record and trying to execute the final restart command. So far, later versions of 10.3 behave correctly.
Regardless, there are no warranties implied or otherwise as to this software's use, misuse, abuse, or and damage resulting from, or due to the use of this software. The developers hold no responsibility for any loss of data. The user (you) of this script should be well aware that they are using this software AT THIER (YOUR) OWN RISK.
The ODBackup script attempts to duplicate the functionality of the OpenDirectory service's "Archive" function in Server Admin.
Users can specify the output path of the resulting image, a passphrase to use when securing/encrypting the image, and verbose logging. It is also possible for this script to generate a random password using uuidgen, notifying the administrator of backup completion, and providing the random passphrase necessary to access the image.
FontCleanup reverts the set of fonts for the System, Library, and current user. All third-party fonts (those not on Apple's list of default fonts for the current system) will be moved into a "Fonts.old" folder at the same level that the fonts were originally installed.*
The default list of fonts should be in files next to this script and should be named 10.X_SystemFonts.txt and 10.X_LibraryFonts.txt, where X is the minor version of the system - otherwise, the paths for each list should be changed inside of the script.