openbsd-ports/www/privoxy/pkg/privoxy.rc
2011-03-25 07:01:14 +00:00

37 lines
739 B
Bash

#!/bin/sh
#
# $OpenBSD: privoxy.rc,v 1.2 2011/03/25 07:01:14 ajacoutot Exp $
daemon="${TRUEPREFIX}/sbin/privoxy"
daemon_flags="--user _privoxy._privoxy --chroot --pre-chroot-nslookup \
www.google.com ${SYSCONFDIR}/privoxy/config"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre()
{
case ${daemon_flags} in
*--chroot*)
pax -rw -u -p e ${SYSCONFDIR}/privoxy /var/privoxy/
pax -rw -u -p e ${SYSCONFDIR}/hosts /var/privoxy/
pax -rw -u -p e ${SYSCONFDIR}/resolv.conf /var/privoxy/
;;
esac
}
rc_post()
{
# preserve config changes made inside the chroot
# (for instance via the web interface)
case ${daemon_flags} in
*--chroot*)
cd /var/privoxy${SYSCONFDIR} && \
pax -rw -u -p e ./privoxy ${SYSCONFDIR}
;;
esac
}
rc_cmd $1