summaryrefslogtreecommitdiffstats
path: root/package/squid/S97squid
blob: 535b1d9622b3690522cd9b19187e30b8fc75a4f6 (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
32
33
34
35
36
37
38
39
40
#!/bin/sh

[ -x /usr/sbin/squid ] || exit 0
[ -f /etc/squid.conf ] || exit 0

case "$1" in
  start)
    printf "Starting squid: "
    if [ ! -d /var/log/squid ]; then
      mkdir -p /var/log/squid
      chown squid:squid /var/log/squid
    fi
    start-stop-daemon -S -x /usr/sbin/squid
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;

   stop)
    printf "Stopping squid: "
    /usr/sbin/squid -k shutdown
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;

  reload)
    printf "Reloading squid configuration: "
    /usr/sbin/squid -k reconfigure
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;

  restart)
    printf "Restarting squid: "
    /usr/sbin/squid -k restart
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;

  *)
    echo "Usage: $0 {start|stop|reload|restart}"
    exit 1
esac

exit 0
OpenPOWER on IntegriCloud