[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Backport osx backout
Update of /home/or/cvsroot/tor/contrib/osx
In directory moria:/tmp/cvs-serv11554/contrib/osx
Modified Files:
Tag: tor-0_1_0-patches
addsysuser
Log Message:
Backport osx backout
Index: addsysuser
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/addsysuser,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- addsysuser 26 Jul 2005 00:34:27 -0000 1.3.2.1
+++ addsysuser 4 Aug 2005 22:32:51 -0000 1.3.2.2
@@ -4,6 +4,8 @@
#
# Modified for Tor installer by Nick Mathewson
+ROOTPROP=/
+
if [ "`whoami`" != "root" ]; then
echo "You must be root to execute this script."
exit
@@ -16,8 +18,8 @@
realname=$2
homedir=$3
# GID 20 is "staff" which is the default. Change it if you want.
-gid=`niutil -readprop . /groups/daemon gid`
-if [ "x`niutil -list . /users|cut -f2 -d' '|grep $username`" != "x" ]; then
+gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
+if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
echo The account $username already exists.
exit 0
fi
@@ -30,14 +32,14 @@
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 . /users/$username
-niutil -createprop . /users/$username _writers_tim_passwd $username
-niutil -createprop . /users/$username realname $realname
-niutil -createprop . /users/$username _writers_passwd $username
-niutil -createprop . /users/$username uid $uiddef
-#niutil -createprop . /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
-niutil -createprop . /users/$username gid $gid
-niutil -createprop . /users/$username home $homedir
-niutil -createprop . /users/$username name $username
-niutil -createprop . /users/$username passwd '*'
-niutil -createprop . /users/$username shell /dev/null
+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