| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | #!/bin/sh# PolipoPostflight gets invoked after any install or upgrade.ADDSYSUSER=$RECEIPT_PATH/addsysuserif [ ! -x "$ADDSYSUSER" ]; then  echo "Could not find addsysuser script."  exit 1fiPOLIPOUSER=_polipoPOLIPOGROUP=daemonTARGET=$2/Library/PolipoLOGDIR=$TARGET/log# Check defaults for TARGETif [ "$TARGET" == "//Library/Polipo" ]; then	TARGET=/Library/Polipofi# Create user $POLIPOUSER in group daemon.  If it's already there, great.$ADDSYSUSER $POLIPOUSER "Polipo System user" $POLIPODIR# Create the polipo direcpolipoy, if it doesn't exist.if [ ! -d $POLIPODIR ]; then  mkdir -p $POLIPODIRfiif [ ! -d $LOGDIR ]; then  mkdir -p $LOGDIRfi# Check its permissions.chown $POLIPOUSER $POLIPODIRchgrp daemon $POLIPODIRchmod 700 $POLIPODIRchown $POLIPOUSER $LOGDIRchgrp daemon $LOGDIRchmod 700 $LOGDIR# Create the configuration file only if there wasn't one already.if [ ! -f $TARGET/config]; then  cp $TARGET/config.osx $TARGET/configficd /usr/share/man/man1MAN1=$TARGET/man/man1ln -sf $MAN1/*.1 .if [ -d /Library/StartupItems/Polipo ]; then  find /Library/StartupItems/Polipo -print0 | xargs -0 chown root:wheelfi# Copy Uninstallerif [ -f $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh ]; then   cp $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh $TARGET/uninstall_polipo_bundle.sh   chmod 755 $TARGET/uninstall_polipo_bundle.shfi
 |