mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 02:09:24 +01:00
Patch from martin fong in flyspray #555, backport candidate once
tested. Update torbutton version in TorPostFlight. svn:r12554
This commit is contained in:
parent
22cd3a4baa
commit
2075c16e1b
@ -46,7 +46,7 @@ TORGROUP=daemon
|
||||
TARGET=$2/Library/Tor
|
||||
TORDIR=$TARGET/var/lib/tor
|
||||
LOGFILE=/var/log/tor.log
|
||||
TORBUTTON_VERSION="1.1.9.1-alpha"
|
||||
TORBUTTON_VERSION="1.1.11-alpha"
|
||||
|
||||
# Check defaults for TARGET
|
||||
if [ "$TARGET" == "//Library/Tor" ]; then
|
||||
|
@ -11,16 +11,18 @@
|
||||
ROOTPROP=/
|
||||
|
||||
if [ "`whoami`" != "root" ]; then
|
||||
echo "You must be root to execute this script."
|
||||
exit
|
||||
echo "You must be root to execute this script."
|
||||
exit
|
||||
fi
|
||||
if [ "x$3" = "x" ]; then
|
||||
echo 'Usage: addsysuser <username> "<full name>" <homedir>'
|
||||
exit 0
|
||||
echo 'Usage: addsysuser <username> "<full name>" <homedir>'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
username=$1
|
||||
realname=$2
|
||||
homedir=$3
|
||||
|
||||
if [ -x /usr/bin/dscl ]; then
|
||||
# Determine the gid of the daemon group
|
||||
gid=`dscl . -read /groups/daemon gid`
|
||||
@ -28,6 +30,17 @@ if [ -x /usr/bin/dscl ]; then
|
||||
echo The account $username already exists.
|
||||
exit 0
|
||||
fi
|
||||
if [ -x /usr/bin/nidump ]; then
|
||||
uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
|
||||
else
|
||||
_tmp=/tmp/_dsexport_tmp.txt.$$
|
||||
rm -f $_tmp
|
||||
dsexport $_tmp '/Local/Default' 'dsRecTypeStandard:Users' > /dev/null 2>&1
|
||||
uiddef=`cat $_tmp | sed 's/\\\://g' | cut -d: -f6 | grep '^[0-9]' | sort -n | grep -v '^[56789]..' | grep -v '^....$' | tail -n 1`
|
||||
rm -f $_tmp
|
||||
fi
|
||||
uiddef=`echo $uiddef + 1 | bc`
|
||||
dscl . -create /users/$username uid $uiddef
|
||||
# home is the local path to the home directory
|
||||
home=/Users/$username
|
||||
echo Creating account for $username...
|
||||
|
Loading…
Reference in New Issue
Block a user