aboutsummaryrefslogtreecommitdiff
path: root/www/privoxy/files/privoxy.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/privoxy/files/privoxy.sh.in')
-rw-r--r--www/privoxy/files/privoxy.sh.in50
1 files changed, 50 insertions, 0 deletions
diff --git a/www/privoxy/files/privoxy.sh.in b/www/privoxy/files/privoxy.sh.in
new file mode 100644
index 000000000000..8afe39dda4a7
--- /dev/null
+++ b/www/privoxy/files/privoxy.sh.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+#
+
+# PROVIDE: privoxy
+# REQUIRE: NETWORKING
+
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+# SET THEM IN THE /etc/rc.conf FILE
+#
+privoxy_enable=${privoxy_enable-"NO"}
+privoxy_flags=${privoxy_flags-""}
+privoxy_pidfile=${privoxy_pidfile-"/var/run/privoxy.pid"}
+
+. %%RC_SUBR%%
+
+name="privoxy"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/privoxy"
+stop_cmd="privoxy_stop"
+start_cmd="privoxy_start"
+
+pidfile="${privoxy_pidfile}"
+configfile=%%PREFIX%%/etc/privoxy/config
+
+privoxy_start()
+{
+ if [ -f ${pidfile} ] ;then
+ echo "${name} is already running"
+ else
+ echo "Starting ${name}."
+ ${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile} \
+ 1>/dev/null 2>&1
+ fi
+}
+
+privoxy_stop()
+{
+ if [ ! -f ${pidfile} ] ;then
+ echo "${name} is not running"
+ else
+ kill -9 `cat ${pidfile}`
+ rm -f ${pidfile}
+ echo "${name} stopped"
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"