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."
13 TARGET
=$2/Library
/Polipo
16 # Check defaults for TARGET
17 if [ "$TARGET" == "//Library/Polipo" ]; then
18 TARGET
=/Library
/Polipo
21 # Create user $POLIPOUSER in group daemon. If it's already there, great.
22 $ADDSYSUSER $POLIPOUSER "Polipo System user" $POLIPODIR
24 # Create the polipo direcpolipoy, if it doesn't exist.
25 if [ ! -d $POLIPODIR ]; then
28 if [ ! -d $LOGDIR ]; then
31 # Check its permissions.
32 chown
$POLIPOUSER $POLIPODIR
33 chgrp daemon
$POLIPODIR
35 chown
$POLIPOUSER $LOGDIR
39 # Create the configuration file only if there wasn't one already.
40 if [ ! -f $TARGET/config
]; then
41 cp $TARGET/config.osx
$TARGET/config
44 cd /usr
/share
/man
/man1
45 MAN1
=$TARGET/share
/man
/man1
47 if [ -d /Library
/StartupItems
/Polipo
]; then
48 find /Library
/StartupItems
/Polipo
-print0 |
xargs -0 chown root
:wheel
52 if [ -f $PACKAGE_PATH/Contents
/Resources
/uninstall_polipo_bundle.sh
]; then
53 cp $PACKAGE_PATH/Contents
/Resources
/uninstall_polipo_bundle.sh
$TARGET/uninstall_polipo_bundle.sh
54 chmod 755 $TARGET/uninstall_polipo_bundle.sh