mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Fix a potential issue in the osx pre and postflight scripts.
svn:r11548
This commit is contained in:
parent
fdf390525c
commit
6aadc6071e
@ -83,10 +83,10 @@ if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If the pre-install script did it's thing, it should have saved the
|
# If the pre-install script did it's thing, it should have saved the
|
||||||
# config and server keys; put these back and clean up
|
# config and server keys; put these back and leave for save keeping
|
||||||
if [ -f /tmp/TorSavedMe.tar.gz ]; then
|
TORBACKUP=`ls -rt /tmp/TorSavedMe*| tail -1`
|
||||||
tar zxf /tmp/TorSavedMe.tar.gz -C /
|
if [ -f ${TORBACKUP} ]; then
|
||||||
rm /tmp/TorSavedMe.tar.gz
|
tar zxf ${TORBACKUP} -C /
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /Library/StartupItems/Tor ]; then
|
if [ -d /Library/StartupItems/Tor ]; then
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# TorPreFlight is invoked before the install begins
|
# TorPreFlight is invoked before the install begins
|
||||||
|
TMPFILE=`mktemp /tmp/TorSavedMe.tgz.XXXXXXXXXXXXX`
|
||||||
|
|
||||||
# Figure out where Tor is installed
|
# Figure out where Tor is installed
|
||||||
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
|
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
|
||||||
@ -16,12 +17,12 @@ fi
|
|||||||
|
|
||||||
# Backup all of Tor, just in case
|
# Backup all of Tor, just in case
|
||||||
if [ -d $TORPATH ]; then
|
if [ -d $TORPATH ]; then
|
||||||
tar zcf /tmp/TorSavedMe.tar.gz $TORPATH/var/lib/tor $TORPATH/torrc $PRIVOXYPATH/config $PRIVOXYPATH/user.action
|
tar zcf ${TMPFILE} ${TORPATH}/var/lib/tor ${TORPATH}/torrc ${PRIVOXYPATH}/config ${PRIVOXYPATH}/user.action
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove Tor and everything to do with it
|
# Remove Tor and everything to do with it
|
||||||
if [ -f $TORPATH/uninstall_tor_bundle.sh ]; then
|
if [ -f ${TORPATH}/uninstall_tor_bundle.sh ]; then
|
||||||
$TORPATH/uninstall_tor_bundle.sh
|
${TORPATH}/uninstall_tor_bundle.sh
|
||||||
else
|
else
|
||||||
$PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh
|
$PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user