Skip to content
Snippets Groups Projects
Commit 5beb8ee4 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Merge remote branch 'sebastian/remove-osx-expert-package' into maint-0.2.2

parents 362bb5c6 fcdf1470
No related branches found
No related tags found
No related merge requests found
Showing
with 8 additions and 614 deletions
......@@ -63,16 +63,6 @@
/contrib/tor.logrotate
/contrib/tor.wxs
# /contrib/osx/
/contrib/osx/Makefile
/contrib/osx/Makefile.in
/contrib/osx/TorBundleDesc.plist
/contrib/osx/TorBundleInfo.plist
/contrib/osx/TorDesc.plist
/contrib/osx/TorInfo.plist
/contrib/osx/TorStartupDesc.plist
/contrib/osx/net.freehaven.tor.plist
# /contrib/suse/
/contrib/suse/tor.sh
/contrib/suse/Makefile.in
......
......@@ -34,25 +34,6 @@ dist-rpm:
mv $$RPM_BUILD_DIR/RPMS/* .; \
rm -rf $$RPM_BUILD_DIR
dist-osx:
@if [ "x$(prefix)" != 'x/Library/Tor' ]; then \
echo "Configure with --prefix=/Library/Tor, please"; \
exit 1; \
fi; \
if [ "x$(bindir)" != 'x/Library/Tor' ]; then \
echo "Configure with --bindir=/Library/Tor, please"; \
exit 1; \
fi; \
if [ "x$(sysconfdir)" != 'x/Library' ]; then \
echo "Configure with --sysconfdir=/Library, please"; \
exit 1; \
fi; \
if [ "x$(CONFDIR)" != 'x/Library/Tor' ]; then \
echo "Configure with CONFDIR=/Library/Tor, please"; \
fi
$(MAKE) all
VERSION=$(VERSION) sh ./contrib/osx/package.sh
dist: check
doxygen:
......
o Removed features:
- Remove everything related to building the expert bundle for OS X. It
has confused many users, doesn't work right on OS X 10.6, and is hard
to get rid of once installed. Resolves bug 1274.
......@@ -915,7 +915,7 @@ fi
CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_zlib"
AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample src/Makefile doc/Makefile doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/test/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh])
AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile src/config/torrc.sample src/Makefile doc/Makefile doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/test/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh])
AC_OUTPUT
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
......
SUBDIRS = osx suse
DIST_SUBDIRS = osx suse
SUBDIRS = suse
DIST_SUBDIRS = suse
confdir = $(sysconfdir)/tor
......
# XXX Is this define necessary, or is it redundant with the
# one from the top-level configure? -RD
confdir = $(sysconfdir)/Tor
EXTRA_DIST = ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \
TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \
TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \
package.sh TorPostflight addsysuser Tor_Uninstaller.applescript \
uninstall_tor_bundle.sh package_list.txt tor_logo.gif TorPreFlight
{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\fs24 \cf0 Tor is a toolset for a wide range of organizations and people who want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and more. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.}
{
Description = "Tor";
Provides = ("tor");
Requires = ("Network");
Uses = ("Network");
OrderPreference = "Last";
Messages =
{
start = "Starting Tor";
stop = "Stopping Tor";
};
}
#!/bin/sh
TORLOC=/Library/StartupItems/Tor/Tor.loc
if [ -f $TORLOC ]; then
TORDIR=`cat /Library/StartupItems/Tor/Tor.loc`
if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then
TORDIR=/Library/Tor
fi
else
TORDIR=/Library/Tor
fi
TORCONF=$TORDIR/torrc
TORDATA=$TORDIR/var/lib/tor
TORPID=/var/run/Tor.pid
TORUSER=_tor
TORGROUP=daemon
TORCMD=$TORDIR/tor
TORLOG=/var/log/tor.log
## Determine OSX Version
# map version to name
if [ -x /usr/bin/sw_vers ]; then
# This is poor, yet functional. We don't care about the 3rd number in
# the OS version
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
"10.6") ARCH="i386";;
"10.5") ARCH="i386";;
"10.4") ARCH="i386";;
"10.3") ARCH="ppc";;
"10.2") ARCH="ppc";;
"10.1") ARCH="ppc";;
"10.0") ARCH="ppc";;
esac
else
ARCH="unknown"
fi
if [ $ARCH != "i386" ]; then
export EVENT_NOKQUEUE=1
fi
##
# Tor Service
##
. /etc/rc.common
StartService ()
{
if [ -f $TORCMD ]; then
if pid=$(GetPID Tor); then
return 0
else
ConsoleMessage "Starting Tor Service"
# Tentative
# Making sure it is not running (I know it is not a best approarch)
killall tor 2>/dev/null
$TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" &
fi
fi
}
StopService ()
{
if pid=$(GetPID Tor); then
ConsoleMessage "Stopping Tor Service"
kill -TERM "${pid}"
# Just for sanity (sometimes necessary.)
killall tor 2>/dev/null
else
ConsoleMessage "Tor Service not responding."
# Just for sanity (sometimes necessary.)
killall tor 2>/dev/null
fi
}
RestartService () { StopService; StartService; }
if [ "$#" = 0 ]; then
echo "Syntax: tor {start|stop}"
exit 1
fi
RunService "$1"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDeleteWarning</key>
<string></string>
<key>IFPkgDescriptionDescription</key>
<string>Bundled package of Tor @VERSION@.</string>
<key>IFPkgDescriptionTitle</key>
<string>Tor Expert Bundle</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Tor Bundle</string>
<key>CFBundleGetInfoString</key>
<string>Tor Bundle @VERSION@</string>
<key>CFBundleIdentifier</key>
<string>org.torproject.torbundle</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<key>IFPkgFlagComponentDirectory</key>
<string>../.contained_packages</string>
<key>IFPkgFlagPackageList</key>
<array>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>Tor.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>required</string>
</dict>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>torstartup.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
</array>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Oblique;\f2\fswiss\fcharset77 Helvetica-Bold;
}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\f0\fs24 \cf0 Welcome to the Tor Expert installer.\
This will install Tor in your computer.\
\
\f0\b0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f2\b \cf0 Tor
\f0\b0 is a system for using the Internet anonymously, and allowing\
others to do so.\
\
For more information, please visit https://www.torproject.org/\
\
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Tor</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Tor @VERSION@</string>
<key>CFBundleGetInfoString</key>
<string>Tor @VERSION@</string>
<key>CFBundleName</key>
<string>Tor</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<key>IFPkgFlagAllowBackRev</key>
<true/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<true/>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IfPkgFlagBackgroundScaling</key>
<string>proportional</string>
<key>IFPkgFlagBackgroundAlignment</key>
<string>bottomleft</string>
</dict>
</plist>
#!/bin/sh
# ====================================================================
# TorPostFlight is distributed under this license
#
# Copyright (c) 2006 Andrew Lewman
# Copyright (c) 2008 The Tor Project
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
# * Neither the names of the copyright owners nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ======================================================================
# TorPostflight gets invoked after any install or upgrade.
ADDSYSUSER=$RECEIPT_PATH/addsysuser
if [ ! -x "$ADDSYSUSER" ]; then
echo "Could not find addsysuser script."
exit 1
fi
TORUSER=_tor
TORGROUP=daemon
TARGET=$2/Library/Tor
TORDIR=$TARGET/var/lib/tor
LOGFILE=/var/log/tor.log
# Check defaults for TARGET
if [ "$TARGET" == "//Library/Tor" ]; then
TARGET=/Library/Tor
fi
# Create user $TORUSER in group daemon. If it's already there, great.
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
# Create the tor directory, if it doesn't exist.
if [ ! -d $TORDIR ]; then
mkdir -p $TORDIR
fi
# Check its permissions.
chown $TORUSER $TORDIR
chgrp daemon $TORDIR
chmod 700 $TORDIR
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
chown $TORUSER $LOGFILE
chgrp daemon $LOGFILE
chmod 660 $LOGFILE
fi
# Create the configuration file only if there wasn't one already.
if [ ! -f $TARGET/torrc ]; then
cp $TARGET/torrc.sample $TARGET/torrc
fi
# Put the geoip database into the datadir
if [ ! -f $TORDIR/geoip ]; then
cp $PACKAGE_PATH/Contents/Resources/geoip $TORDIR/geoip
fi
# Ensure symbolic links
cd /usr/bin
if [ -e /usr/bin/tor -a ! -L /usr/bin/tor ]; then
mv tor tor_old
fi
if [ -e /usr/bin/tor-resolve -a ! -L /usr/bin/tor-resolve ]; then
mv tor-resolve tor-resolve_old
fi
ln -sf $TARGET/tor .
ln -sf $TARGET/tor-resolve .
cd /usr/share/man/man1
MAN1=$TARGET/share/man/man1
#ln -sf $MAN1/*.1 .
# Copy Documentation
if [ -d $PACKAGE_PATH/Contents/Resources/documents ];then
cp -r $PACKAGE_PATH/Contents/Resources/documents $TARGET/documents
fi
# Copy Uninstaller
if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript ]; then
cp $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript $TARGET/Tor_Uninstaller.applescript
chmod 550 $TARGET/Tor_Uninstaller.applescript
fi
if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then
cp $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh $TARGET/uninstall_tor_bundle.sh
chmod 550 $TARGET/uninstall_tor_bundle.sh
fi
if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then
cp $PACKAGE_PATH/Contents/Resources/package_list.txt $TARGET/package_list.txt
fi
if [ -d /Library/StartupItems/Tor ]; then
rm -f /Library/StartupItems/Tor/Tor.loc
echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
fi
#!/bin/sh
#
# ===================================================================
#
# TorPreFlight is distributed under this license:
#
# Copyright (c) 2006 Andrew Lewman
# Copyright (c) 2008 The Tor Project, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
# * Neither the names of the copyright owners nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#===============================================================================
# TorPreFlight is invoked before the install begins
# Figure out where Tor is installed
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
TORPATH=`cat /Library/StartupItems/Tor/Tor.loc`
else
TORPATH="/Library/Tor/"
fi
# Backup all of Tor, just in case
if [ -d $TORPATH ]; then
cp $TORPATH/torrc $TORPATH/torrc.installer-saved
fi
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Tor Startup Script</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Tor Startup Script</string>
<key>CFBundleGetInfoString</key>
<string>Tor Startup Script</string>
<key>CFBundleName</key>
<string>Tor Startup Script</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>IFPkgFlagAllowBackRev</key>
<true/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
</dict>
</plist>
-- Tor Uninstaller.applescript
-- Tor Uninstaller
-- ===============================================================================
-- Tor Uninstaller is distributed under this license:
--
-- Copyright (c) 2005 Andrew Lewman ( pgp key: 31B0974B )
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above
-- copyright notice, this list of conditions and the following disclaimer
-- in the documentation and/or other materials provided with the
-- distribution.
--
-- * Neither the names of the copyright owners nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- ===============================================================================
on run
-- Validate & find disk paths
set boot_disk to (path to startup disk) as string
set default_tor_path to boot_disk & "Library:Tor"
set default_privoxy_path to boot_disk & "Library:Privoxy"
set default_tor_startup_path to boot_disk & "Library:StartupItems:Tor"
set default_privoxy_startup_path to boot_disk & "Library:StartupItems:Privoxy"
set shell_script to default_tor_path & ":uninstall_tor_bundle.sh"
set doomed_path_list to {default_tor_path, default_privoxy_path, default_tor_startup_path, default_privoxy_startup_path}
-- Display what we're removing and ask for validation
-- this is the simplest way to do this
set remove_me to display dialog "Welcome to the Tor + Privoxy Uninstaller. This program will remove:" & return & return & POSIX path of default_tor_path & return & POSIX path of default_privoxy_path & return & POSIX path of default_tor_startup_path & return & POSIX path of default_privoxy_startup_path & return & return & "If this looks correct, choose Yes. Otherwise, choose No." buttons {"Yes", "No"} default button "No"
-- Run a shell script to do all the unix work since applescript can't see it at all
if button returned of result is "Yes" then
try
do shell script (POSIX path of shell_script) with administrator privileges
on error
display dialog "Too many errors, quitting." buttons {"Quit"} default button "Quit" with icon stop giving up after 3
quit
end try
-- So Long and Thanks for all the Fish!
display dialog "Thank you for using tor!" buttons {"Ok"} giving up after 3
else
display dialog "Thank you for your continued use of Tor & Privoxy" buttons {"You're welcome."} giving up after 3
end if
end run
-- We're done
\ No newline at end of file
#!/bin/sh
#
# Original adduser 05 Feb 2002 by Jon L. Gardner
#
# Modified for Tor installer by Nick Mathewson
# 2007-06-12 Modified for leopard by Andrew Lewman
# Copyright (c) 2007 Andrew Lewman
#
ROOTPROP=/
if [ "`whoami`" != "root" ]; then
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
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`
if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; 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...
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
else
# Determine the gid of the daemon group
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
# home is the local path to the home directory
home=/Users/$username
# defhome is what goes into NetInfo
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`
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
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment