openbsd-ports/www/privoxy/pkg/privoxy.rc
ajacoutot 924127a845 Multiline flags are not supported by the new parser for now; so unbreak
default daemon_flags.

reported by Sebastien Marie
2014-08-24 09:17:52 +00:00

36 lines
727 B
Bash

#!/bin/sh
#
# $OpenBSD: privoxy.rc,v 1.4 2014/08/24 09:17:52 ajacoutot Exp $
daemon="${TRUEPREFIX}/sbin/privoxy"
daemon_flags="--user _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