diff options
-rwxr-xr-x | contrib/osx/addsysuser | 34 | ||||
-rwxr-xr-x | contrib/osx/uninstall_tor_bundle.sh | 3 |
2 files changed, 19 insertions, 18 deletions
diff --git a/contrib/osx/addsysuser b/contrib/osx/addsysuser index 7f1d79a97c..c57f46e139 100755 --- a/contrib/osx/addsysuser +++ b/contrib/osx/addsysuser @@ -3,8 +3,7 @@ # Original adduser 05 Feb 2002 by Jon L. Gardner # # Modified for Tor installer by Nick Mathewson - -ROOTPROP=/ +# 2007-06-12 Modified for leopard by Andrew Lewman if [ "`whoami`" != "root" ]; then echo "You must be root to execute this script." @@ -18,8 +17,11 @@ username=$1 realname=$2 homedir=$3 # GID 20 is "staff" which is the default. Change it if you want. -gid=`niutil -readprop $ROOTPROP /groups/daemon gid` -if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then +#gid=`niutil -readprop $ROOTPROP /groups/daemon gid` +gid=`dscl . -read /groups/daemon gid` +echo $gid +#if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then +if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then echo The account $username already exists. exit 0 fi @@ -29,17 +31,15 @@ home=/Users/$username defhome="/Network/Servers/MyServer/Users" #echo "Determining next available system uid (please be patient)..." # Uids over 500 are for system users. -uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1` -uiddef=`echo $uiddef + 1 |bc` +#uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1` +#uiddef=`echo $uiddef + 1 |bc` echo Creating account for $username... -niutil -create $ROOTPROP /users/$username -niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username -niutil -createprop $ROOTPROP /users/$username realname $realname -niutil -createprop $ROOTPROP /users/$username _writers_passwd $username -niutil -createprop $ROOTPROP /users/$username uid $uiddef -#niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>" -niutil -createprop $ROOTPROP /users/$username gid $gid -niutil -createprop $ROOTPROP /users/$username home $homedir -niutil -createprop $ROOTPROP /users/$username name $username -niutil -createprop $ROOTPROP /users/$username passwd '*' -niutil -createprop $ROOTPROP /users/$username shell /dev/null +dscl . -create /users/$username +dscl . -create /users/$username _writers_tim_passwd $username +dscl . -create /users/$username realname $realname +dscl . -create /users/$username _writers_passwd $username +dscl . -create /users/$username gid $gid +dscl . -create /users/$username home $homedir +dscl . -create /users/$username name $username +dscl . -create /users/$username passwd '*' +dscl . -create /users/$username shell /dev/null diff --git a/contrib/osx/uninstall_tor_bundle.sh b/contrib/osx/uninstall_tor_bundle.sh index 18b346005c..c1c6f507af 100755 --- a/contrib/osx/uninstall_tor_bundle.sh +++ b/contrib/osx/uninstall_tor_bundle.sh @@ -128,7 +128,8 @@ done < $PACKAGE_LIST_SRC ## nuke the user created by the install process. echo ". Removing created user $TOR_USER" -niutil -destroy . /users/$TOR_USER +#niutil -destroy . /users/$TOR_USER +dscl . -delete /users/$TOR_USER ## clean up |