summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-polipo/root/usr/sbin/polipo_purge
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-11-05 23:05:09 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-11-05 23:05:09 +0000
commit6d31daf97e8a3e5158901271c10c57633cd4366f (patch)
treea2fa6680699020adbe426f6908abdfc70220fb48 /applications/luci-polipo/root/usr/sbin/polipo_purge
parent7651fd78f055c0f6373027d5dae1f2ce9e8db4c3 (diff)
* luci/applications: add polipo proxy support
Diffstat (limited to 'applications/luci-polipo/root/usr/sbin/polipo_purge')
-rwxr-xr-xapplications/luci-polipo/root/usr/sbin/polipo_purge18
1 files changed, 18 insertions, 0 deletions
diff --git a/applications/luci-polipo/root/usr/sbin/polipo_purge b/applications/luci-polipo/root/usr/sbin/polipo_purge
new file mode 100755
index 0000000000..ce7c88559b
--- /dev/null
+++ b/applications/luci-polipo/root/usr/sbin/polipo_purge
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/polipo
+PIDFILE=`uci get polipo.daemon.pidFile`
+CFGFILE=/var/etc/polipo.conf
+
+[ -e "$PIDFILE" ] && {
+ PID=`cat $PID_FILE`
+
+ # send Polipo USR1 signal to write its in-memory cache to disk
+ kill -USR1 $PID
+ sleep 2
+ # start polipo with -x flag to purge the on-disk cache
+ polipo -c $CFGFILE -x
+ # send Polipo USR2 signal to discard its in-memory cache
+ kill -USR2 $PID
+}
+