b30af5b9f5b13985d3239203d947cf88d6b1a1e3
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / squid / S97squid
1 #!/bin/sh
2
3 [ -x /usr/sbin/squid ] || exit 0
4 [ -f /etc/squid.conf ] || exit 0
5
6 case "$1" in
7   start)
8     echo -n "Starting squid: "
9     if [ ! -d /var/log/squid ]; then
10       mkdir -p /var/log/squid
11       chown squid:squid /var/log/squid
12     fi
13     start-stop-daemon -S -x /usr/sbin/squid
14     [ $? = 0 ] && echo "OK" || echo "FAIL"
15     ;;
16
17    stop)
18     echo -n "Stopping squid: "
19     /usr/sbin/squid -k shutdown
20     [ $? = 0 ] && echo "OK" || echo "FAIL"
21     ;;
22
23   reload)
24     echo -n "Reloading squid configuration: "
25     /usr/sbin/squid -k reconfigure
26     [ $? = 0 ] && echo "OK" || echo "FAIL"
27     ;;
28
29   restart)
30     echo -n "Restarting squid: "
31     /usr/sbin/squid -k restart
32     [ $? = 0 ] && echo "OK" || echo "FAIL"
33     ;;
34
35   *)
36     echo "Usage: $0 {start|stop|reload|restart}"
37     exit 1
38 esac
39
40 exit 0