useradd.sh v1.2
Sat Dec 15, 2007 · 161 words

I've updated useradd to support both Tiger and Leopard. Many thanks go to Allan Sanderson for his Leopard changes and bringing the need for an update to my attention in the first place!

There are some other improvements as well, including checking if the user already exists, cloning the non-localized bits from the User Template and semi-random, dictionary-based default passwords.

I've tested the script on 10.4.10 and 10.5.1.

Some remarks:

os_ver=$(sysctl -n kern.osrelease)
os_ver=${os_ver:0:1}
if [ $os_ver -lt 9 ]
  then # something Tiger specific...
fi

back · essays · credits ·