openbsd-ports/www/privoxy/pkg/privoxy.rc

37 lines
739 B
Plaintext
Raw Normal View History

2011-03-24 22:57:10 -04:00
#!/bin/sh
#
2011-03-25 03:01:14 -04:00
# $OpenBSD: privoxy.rc,v 1.2 2011/03/25 07:01:14 ajacoutot Exp $
2011-03-24 22:57:10 -04:00
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*)
2011-03-25 03:01:14 -04:00
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/
;;
2011-03-24 22:57:10 -04:00
esac
}
rc_post()
{
2011-03-25 03:01:14 -04:00
# preserve config changes made inside the chroot
# (for instance via the web interface)
2011-03-24 22:57:10 -04:00
case ${daemon_flags} in
*--chroot*)
2011-03-25 03:01:14 -04:00
cd /var/privoxy${SYSCONFDIR} && \
pax -rw -u -p e ./privoxy ${SYSCONFDIR}
;;
2011-03-24 22:57:10 -04:00
esac
}
rc_cmd $1