File: polipo.cron.daily

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-- 460 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

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")

su -s /bin/sh -c \
    "nice polipo -x -c $CONFIG_FILE forbiddenFile=$FORBIDDEN_FILE > /dev/null" \
    proxy

[ -f "$PIDFILE" ] && kill -USR2 $(cat "$PIDFILE")

exit 0