123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- 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
- TORBUTTON_VERSION="1.1.11-alpha"
- if [ "$TARGET" == "//Library/Tor" ]; then
- TARGET=/Library/Tor
- fi
- $ADDSYSUSER $TORUSER "Tor System user" $TORDIR
- if [ ! -d $TORDIR ]; then
- mkdir -p $TORDIR
- fi
- 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
- if [ ! -f $TARGET/torrc ]; then
- cp $TARGET/torrc.sample $TARGET/torrc
- fi
- 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
- if [ -d /Library/StartupItems/Privoxy ]; then
- find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel
- fi
- if [ -d $PACKAGE_PATH/Contents/Resources/documents ];then
- cp -r $PACKAGE_PATH/Contents/Resources/documents $TARGET/documents
- fi
- 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
- if [ -f /Applications/Firefox.app/Contents/MacOS/firefox ]; then
- if [ -f $TARGET/torbutton-$TORBUTTON_VERSION.xpi ]; then
- /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension $TARGET/torbutton-$TORBUTTON_VERSION.xpi
- USR=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $3}'`
- GRP=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $4}'`
- chown -R $USR:$GRP /Applications/Firefox.app/Contents/MacOS/extensions/
- fi
- fi
|