updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / varnish / varnish.init
blobb90ebf597c7399dbd0c269ddf5a8ae4b10e5515f
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 . /etc/varnish.conf
9 PID=`pidof %PPID /usr/sbin/varnishd`
11 case "$1" in
12 start)
13 stat_busy "Starting Varnish Reverse Proxy"
14 /usr/sbin/varnishd $OPTS
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon varnish
19 stat_done
22 stop)
23 stat_busy "Stopping Varnish Reverse Proxy"
24 kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon varnish
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0