* luci/applications: add polipo proxy support
[project/luci.git] / applications / luci-polipo / root / usr / sbin / polipo_purge
1 #!/bin/sh
2
3 DAEMON=/usr/sbin/polipo
4 PIDFILE=`uci get polipo.daemon.pidFile`
5 CFGFILE=/var/etc/polipo.conf
6
7 [ -e "$PIDFILE" ] && {
8         PID=`cat $PID_FILE`
9
10         # send Polipo USR1 signal to write its in-memory cache to disk
11         kill -USR1 $PID
12         sleep 2
13         # start polipo with -x flag to purge the on-disk cache
14         polipo -c $CFGFILE -x
15         # send Polipo USR2 signal to discard its in-memory cache
16         kill -USR2 $PID
17 }
18