summaryrefslogtreecommitdiff
path: root/network/polipo/rc.polipo
blob: 419e9b0fad94e9380a9fb795d9ce1891b45b06e1 (plain)
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
27
28
29
30
31
#!/bin/sh

# Force the pid file to a known location
PIDFILE="/var/run/polipo/polipo.pid"

start() {
  echo "Starting polipo..."
  mkdir -p $(dirname $PIDFILE)
  polipo daemonise=true pidFile=$PIDFILE
}

stop() {
  echo "Stopping polipo..."
  kill $(cat $PIDFILE)
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    sleep 1
    start
    ;;
  *)
    echo "Usage: $0 (start|stop|restart)"
esac