diff options
author | Alin Năstac <mrness@gentoo.org> | 2006-01-15 20:28:55 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2006-01-15 20:28:55 +0000 |
commit | aa6bd45e2c625f38459159a85480a639ddcee30c (patch) | |
tree | 69aab8a908cb33dde19312e24c5d6cab80a2ab5b /net-proxy/havp/files/havp.initd | |
parent | Removed redundant dependencies provided by java.eclass (bug #118651). (diff) | |
download | historical-aa6bd45e2c625f38459159a85480a639ddcee30c.tar.gz historical-aa6bd45e2c625f38459159a85480a639ddcee30c.tar.bz2 historical-aa6bd45e2c625f38459159a85480a639ddcee30c.zip |
Initial import from bug #99303.
Package-Manager: portage-2.0.53
Diffstat (limited to 'net-proxy/havp/files/havp.initd')
-rw-r--r-- | net-proxy/havp/files/havp.initd | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/net-proxy/havp/files/havp.initd b/net-proxy/havp/files/havp.initd new file mode 100644 index 000000000000..c3b13f9cc804 --- /dev/null +++ b/net-proxy/havp/files/havp.initd @@ -0,0 +1,64 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net clamd + #havp could be used in conjuction with any parent proxies from below + use squid apache2 bfilter mman junkbuster oops polipo privoxy tinyproxy wwwoffled +} + +get_havp_opt() { + eval HAVP_$1=`awk '/^[ \t]*'$1'[ \t]+/ { print $2; }' < /etc/havp/havp.config` +} + +checkconfig() { + if [ ! -d /var/run/havp ] && ! mkdir /var/run/havp; then + eeror "Failed to create /var/run/havp" + return 1 + fi + if [ ! -d /var/tmp/havp ] && ! mkdir /var/tmp/havp; then + eeror "Failed to create /var/tmp/havp" + return 1 + fi + + if [ ! -f /etc/havp/havp.config ] ; then + eerror "No /etc/havp/havp.config file exists!" + return 1 + fi + + local HAVP_USER + get_havp_opt USER + if [ -n "${HAVP_USER}" ] && ! getent passwd ${HAVP_USER} > /dev/null ; then + eerror "${HAVP_USER} user is missing!" + return 1 + fi + local HAVP_GROUP + get_havp_opt GROUP + if [ -n "${HAVP_GROUP}" ] && ! getent group ${HAVP_GROUP} > /dev/null ; then + eerror "${HAVP_GROUP} group is missing!" + return 1 + fi + + chown -R "${HAVP_USER:-nobody}:${HAVP_GROUP:-nobody}" /var/run/havp /var/tmp/havp /var/log/havp && \ + chmod -R 0755 /var/run/havp && + chmod -R 0750 /var/tmp/havp +} + + +start() { + checkconfig || return 1 + + ebegin "Starting HTTP AntiVirus proxy" + start-stop-daemon --start --exec /usr/sbin/havp > /dev/null + eend $? +} + +stop() { + local HAVP_PIDFILE + get_havp_opt PIDFILE + + ebegin "Stopping HTTP AntiVirus proxy" + start-stop-daemon --stop --pidfile=${HAVD_PIDFILE:-/var/run/havp/havp.pid} + eend $? +} |