#! /bin/sh
+### BEGIN INIT INFO
+# Provides: privoxy
+# Required-Start: $local_fs $remote_fs $network $time
+# Required-Stop: $local_fs $remote_fs $network $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Privacy enhancing HTTP Proxy
+# Description: Privoxy is a web proxy with advanced filtering
+# capabilities for protecting privacy, filtering
+# web page content, managing cookies, controlling
+# access, and removing ads, banners, pop-ups and
+# other obnoxious Internet junk.
+### END INIT INFO
+
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/privoxy
NAME=privoxy
2>> /var/log/privoxy/errorfile
echo "$NAME."
;;
+
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
rm -f $PIDFILE
echo "$NAME."
;;
- #reload)
- #
- # If the daemon can reload its config files on the fly
- # for example by sending it SIGHUP, do it here.
- #
- # If the daemon responds to changes in its config file
- # directly anyway, make this a do-nothing entry.
- #
- # echo "Reloading $DESC configuration files."
- # start-stop-daemon --stop --signal 1 --quiet --pidfile \
- # /var/run/$NAME.pid --exec $DAEMON
- #;;
+
restart|force-reload)
- #
- # If the "reload" option is implemented, move the "force-reload"
- # option to the "reload" entry above. If not, "force-reload" is
- # just the same as "restart".
- #
echo -n "Restarting $DESC: "
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
2>> /var/log/privoxy/errorfile
echo "$NAME."
;;
+
+ status)
+ echo -n "Status of $DESC: "
+ if [ ! -r "$PIDFILE" ]; then
+ echo "$NAME is not running."
+ exit 3
+ fi
+ if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
+ echo "$NAME is running."
+ exit 0
+ else
+ echo "$NAME is not running but $PIDFILE exists."
+ exit 1
+ fi
+ ;;
+
*)
N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac