and give the bug 969 fixes a changelog
[tor/rransom.git] / contrib / polipo / PolipoPostflight
blob0894caec6c48ce7bf261eaf686a67a77524ec7bd
1 #!/bin/sh
3 # PolipoPostflight gets invoked after any install or upgrade.
5 ADDSYSUSER=$RECEIPT_PATH/addsysuser
6 if [ ! -x "$ADDSYSUSER" ]; then
7 echo "Could not find addsysuser script."
8 exit 1
9 fi
11 POLIPOUSER=_polipo
12 POLIPOGROUP=daemon
13 TARGET=/Library/Polipo
14 LOGDIR=$TARGET/log
16 # Create user $POLIPOUSER in group daemon. If it's already there, great.
17 $ADDSYSUSER $POLIPOUSER "Polipo System user" $POLIPODIR
19 # Create the polipo direcpolipoy, if it doesn't exist.
20 if [ ! -d $POLIPODIR ]; then
21 mkdir -p $POLIPODIR
23 if [ ! -d $LOGDIR ]; then
24 mkdir -p $LOGDIR
26 # Check its permissions.
27 chown $POLIPOUSER $POLIPODIR
28 chgrp daemon $POLIPODIR
29 chmod 700 $POLIPODIR
30 chown $POLIPOUSER $LOGDIR
31 chgrp daemon $LOGDIR
32 chmod 700 $LOGDIR
34 # Create the configuration file only if there wasn't one already.
35 if [ ! -f $TARGET/config]; then
36 cp $TARGET/config.osx $TARGET/config
39 cd /usr/share/man/man1
40 MAN1=$TARGET/share/man/man1
42 if [ -d /Library/StartupItems/Polipo ]; then
43 find /Library/StartupItems/Polipo -print0 | xargs -0 chown root:wheel
46 # Copy Uninstaller
47 if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh ]; then
48 cp $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh $TARGET/uninstall_polipo_bundle.sh
49 chmod 755 $TARGET/uninstall_polipo_bundle.sh