Various privoxy fixes:
[openwrt/svn-archive/archive.git] / net / privoxy / files / privoxy.init
index 7c9e018bee060b596e211d4885f1e4ad57962f1d..46a46c7f3c3bb20a207ee9b055fe71ee330c2f3d 100644 (file)
@@ -1,11 +1,15 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
-conf=/etc/privoxy/config
+
+CFG_F=/etc/privoxy/config
+RUN_D=/var/run
+PID_F=$RUN_D/privoxy.pid
 
 start() {
 
 start() {
-        /usr/sbin/privoxy $conf
+       mkdir -p $RUN_D
+       /usr/sbin/privoxy --pidfile $PID_F $CFG_F
 }
 
 stop() {
 }
 
 stop() {
-        killall privoxy
+       [ -f $PID_F ] && kill $(cat $PID_F)
 }
 }