File: polipo.cron.weekly

package info (click to toggle)
polipo 1.1.1-5~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 1,204 kB
  • sloc: ansic: 20,882; python: 238; sh: 234; makefile: 139
file content (26 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# script to handle trimming of the polipo cache

set -e

# set reasonable defaults
POLIPO_TRIM=0
POLIPO_TARGET_SIZE=256M
diskCacheRoot=/var/cache/polipo

# read configuration values
[ -r /etc/polipo/trim ] || exit 0
. /etc/polipo/trim

# source'ing the polipo config file is a bit more involved
# since it might contain spaces. Read $diskCacheRoot variable
eval "$(sed s/\ //g < /etc/polipo/config)"

# stop if the package was removed but not purged
[ -x /usr/lib/polipo/polipo_trimcache ] || exit 0

# now do the trimming if requested
[ $POLIPO_TRIM = 1 ] && python /usr/lib/polipo/polipo_trimcache $diskCacheRoot $POLIPO_TARGET_SIZE

exit 0