aboutsummaryrefslogtreecommitdiff
path: root/system/c-icap/rc.c-icap
blob: 6dc06609ba6916fd2dcdd0b8f0a53698f30a9f4c (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
#!/bin/sh
# Start/stop/restart c-icap.

# Start c-icap:
icap_start() {
  CMDLINE="/usr/bin/c-icap"
  echo -n "Starting c-icap daemon:  $CMDLINE"
  $CMDLINE -f /etc/c-icap.conf
  echo
}

# Stop c-icap:
icap_stop() {
  echo -n "Stopping c-icap daemon..."
  for i in $(pgrep -f c-icap); do kill -15 $i; done
  echo
}

# Restart c-icap:
icap_restart() {
  icap_stop
  sleep 1
  icap_start
}

case "$1" in
'start')
  icap_start
  ;;
'stop')
  icap_stop
  ;;
'restart')
  icap_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac