summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-polipo/root
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
parent7651fd78f055c0f6373027d5dae1f2ce9e8db4c3 (diff)
* luci/applications: add polipo proxy support
Diffstat (limited to 'applications/luci-polipo/root')
-rw-r--r--applications/luci-polipo/root/etc/uci-defaults/luci-polipo7
-rwxr-xr-xapplications/luci-polipo/root/usr/sbin/polipo_purge18
2 files changed, 25 insertions, 0 deletions
diff --git a/applications/luci-polipo/root/etc/uci-defaults/luci-polipo b/applications/luci-polipo/root/etc/uci-defaults/luci-polipo
new file mode 100644
index 0000000000..8a033f8c35
--- /dev/null
+++ b/applications/luci-polipo/root/etc/uci-defaults/luci-polipo
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+uci batch <<-EOF
+ add ucitrack polipo
+ set ucitrack.@polipo[-1].init=polipo
+ commit ucitrack
+EOF
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
+}
+