mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
So long, farewell, auf Wiedersehen, adieu, launchd
svn:r6932
This commit is contained in:
parent
e469438d20
commit
498fe87434
@ -7,4 +7,4 @@ EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \
|
||||
package.sh privoxy.config TorPostflight addsysuser \
|
||||
Tor_Uninstaller.applescript uninstall_tor_bundle.sh \
|
||||
package_list.txt tor_logo.gif Tor_Uninstaller.app.tar.gz \
|
||||
net.freehaven.tor.plist.in TorPreFlight
|
||||
TorPreFlight
|
||||
|
@ -19,25 +19,6 @@ if [ "$TARGET" == "//Library/Tor" ]; then
|
||||
TARGET=/Library/Tor
|
||||
fi
|
||||
|
||||
## 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.5") OS="leopard";;
|
||||
"10.4") OS="tiger";;
|
||||
"10.3") OS="panther";;
|
||||
"10.2") OS="jaguar";;
|
||||
"10.1") OS="puma";;
|
||||
"10.0") OS="cheetah";;
|
||||
*) OS="unknown";;
|
||||
esac
|
||||
else
|
||||
OS="unknown"
|
||||
fi
|
||||
|
||||
# Create user $TORUSER in group daemon. If it's already there, great.
|
||||
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
|
||||
|
||||
@ -117,33 +98,11 @@ fi
|
||||
# If the pre-install script did it's thing, it should have saved the
|
||||
# config and server keys; put these back and clean up
|
||||
if [ -f /tmp/TorSavedMe.tar.gz ]; then
|
||||
tar zxf /tmp/TorSavedMe.tar.gz -C /
|
||||
rm /tmp/TorSavedMe.tar.gz
|
||||
tar zxf /tmp/TorSavedMe.tar.gz -C /
|
||||
rm /tmp/TorSavedMe.tar.gz
|
||||
fi
|
||||
|
||||
# Determine how to start by OS Version
|
||||
if [ $OS = "tiger" ]; then
|
||||
if [ -f $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist ]; then
|
||||
rm -rf /Library/StartupItems/Tor
|
||||
cp $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist /System/Library/LaunchDaemons/net.freehaven.tor.plist
|
||||
chmod 644 /System/Library/LaunchDaemons/net.freehaven.tor.plist
|
||||
if [ -f $TARGET/torrc ]; then
|
||||
IFS=,
|
||||
CONFIGVARS="#--START,RunAsDaemon 0,Log notice file $TARGET/var/log/tor/tor.log,DataDirectory $TARGET/var/lib/tor,Group daemon,User _tor,PidFile /var/run/Tor.pid,#--END"
|
||||
for var in ${CONFIGVARS}
|
||||
do
|
||||
RC=`grep ^$var $TARGET/torrc`
|
||||
if [ -z $RC ]; then
|
||||
echo "$var" >> $TARGET/torrc
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
/bin/launchctl load /System/Library/LaunchDaemons/net.freehaven.tor.plist
|
||||
/bin/launchctl start net.freehaven.tor
|
||||
else
|
||||
if [ -d /Library/StartupItems/Tor ]; then
|
||||
rm -f /Library/StartupItems/Tor/Tor.loc
|
||||
echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
|
||||
fi
|
||||
if [ -d /Library/StartupItems/Tor ]; then
|
||||
rm -f /Library/StartupItems/Tor/Tor.loc
|
||||
echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
|
||||
fi
|
||||
|
@ -4,8 +4,6 @@
|
||||
# Figure out where Tor is installed
|
||||
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
|
||||
TORPATH=`cat /Library/StartupItems/Tor/Tor.loc`
|
||||
elif [ -f /System/Library/LaunchDaemons/net.freehaven.tor.plist ]; then
|
||||
TORPATH=/`grep -A1 "<key>Program</key>" /System/Library/LaunchDaemons/net.freehaven.tor.plist | grep string | cut -d"/" -f2,3`
|
||||
else
|
||||
TORPATH="/Library/Tor/"
|
||||
fi
|
||||
|
@ -90,7 +90,6 @@ cp contrib/osx/Tor_Uninstaller.app.tar.gz $BUILD_DIR/tor_resources/Tor_Uninstall
|
||||
cp contrib/osx/uninstall_tor_bundle.sh $BUILD_DIR/tor_resources/uninstall_tor_bundle.sh
|
||||
cp contrib/osx/package_list.txt $BUILD_DIR/tor_resources/package_list.txt
|
||||
cp contrib/osx/tor_logo.gif $BUILD_DIR/tor_resources/background.gif
|
||||
cp contrib/osx/net.freehaven.tor.plist $BUILD_DIR/tor_resources/net.freehaven.tor.plist
|
||||
cat <<EOF > $BUILD_DIR/tor_resources/Welcome.txt
|
||||
Tor: an anonymous Internet communication system
|
||||
|
||||
|
@ -135,9 +135,6 @@ niutil -destroy . /users/$TOR_USER
|
||||
echo ". Cleaning up"
|
||||
rm -rf $TEMP_BOM_CONTENTS
|
||||
rm -rf /Library/Privoxy/ /Library/StartupItems/Privoxy/ /Library/Tor/ /Library/StartupItems/Tor/
|
||||
if [ -f /System/Library/LaunchDaemons/net.freehaven.tor.plist ]; then
|
||||
rm /System/Library/LaunchDaemons/net.freehaven.tor.plist
|
||||
fi
|
||||
|
||||
echo ". Finished"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user