diff options
author | Andrew Lewman <andrew@torproject.org> | 2007-10-14 12:29:26 +0000 |
---|---|---|
committer | Andrew Lewman <andrew@torproject.org> | 2007-10-14 12:29:26 +0000 |
commit | d628b632854a724659a9d924da8102f71e04c891 (patch) | |
tree | 4d8b41945815d408c3892b0e1cb4f90e5cbb9a3e | |
parent | 291dc2eeed24907df1c129823d8fd13d3074ea06 (diff) | |
download | tor-d628b632854a724659a9d924da8102f71e04c891.tar.gz tor-d628b632854a724659a9d924da8102f71e04c891.zip |
backport torpostflight changes
svn:r11931
-rw-r--r-- | contrib/osx/TorPostflight | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight index 524e5a6650..a0f86cf822 100644 --- a/contrib/osx/TorPostflight +++ b/contrib/osx/TorPostflight @@ -12,7 +12,7 @@ TORUSER=_tor TORGROUP=daemon TARGET=$2/Library/Tor TORDIR=$TARGET/var/lib/tor -LOGDIR=$TARGET/var/log/tor +LOGFILE=/var/log/tor.log # Check defaults for TARGET if [ "$TARGET" == "//Library/Tor" ]; then @@ -26,20 +26,21 @@ $ADDSYSUSER $TORUSER "Tor System user" $TORDIR if [ ! -d $TORDIR ]; then mkdir -p $TORDIR fi -if [ ! -d $LOGDIR ]; then - mkdir -p $LOGDIR -fi # Check its permissions. chown $TORUSER $TORDIR chgrp daemon $TORDIR chmod 700 $TORDIR -chown $TORUSER $LOGDIR -chgrp daemon $LOGDIR -chmod 700 $LOGDIR + +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 + cp $TARGET/torrc.sample $TARGET/torrc.sample fi # Ensure symbolic links @@ -57,12 +58,6 @@ cd /usr/share/man/man1 MAN1=$TARGET/man/man1 ln -sf $MAN1/*.1 . -if [ ! -e /var/log/tor -o -L /var/log/tor ]; then - cd /var/log - rm -f tor - ln -sf $LOGDIR tor -fi - if [ -d /Library/StartupItems/Privoxy ]; then find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel fi @@ -75,25 +70,18 @@ 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 755 $TARGET/Tor_Uninstaller.applescript + chmod 555 $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 755 $TARGET/uninstall_tor_bundle.sh + chmod 555 $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 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 -fi - if [ -d /Library/StartupItems/Tor ]; then rm -f /Library/StartupItems/Tor/Tor.loc echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc |