From 8f1d1c4ef7a1298d448416997218dafb5d40166f Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 28 Oct 2011 16:50:30 +0200 Subject: decouple polipo and torsocks into their own subclasses, so we can for example also just install tor --- files/polipo/polipo.cron | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 files/polipo/polipo.cron (limited to 'files/polipo/polipo.cron') diff --git a/files/polipo/polipo.cron b/files/polipo/polipo.cron new file mode 100755 index 0000000..aba88bc --- /dev/null +++ b/files/polipo/polipo.cron @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +FORBIDDEN_FILE=/etc/polipo/forbidden +CONFIG_FILE=/etc/polipo/config + +if [ ! -x /usr/bin/polipo ]; then + exit 0 +fi + +if [ ! -f $FORBIDDEN_FILE ]; then + FORBIDDEN_FILE=/dev/null +fi + +PIDFILE=/var/run/polipo/polipo.pid +[ -f "$PIDFILE" ] && kill -USR1 $(cat "$PIDFILE") +# TODO: remove redirect stderr to /dev/null after the following bug is solved: +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580434 +su -c \ + "nice polipo -x -c $CONFIG_FILE forbiddenFile=$FORBIDDEN_FILE > /dev/null" \ + proxy &> /dev/null +[ -f "$PIDFILE" ] && kill -USR2 $(cat "$PIDFILE") -- cgit v1.2.3