3 # c-icap This shell script takes care of starting and stopping
8 # description: c-icap ICAP server
11 # pidfile: /var/run/c-icap/c-icap.pid
12 # config: /etc/c-icap/c-icap.conf
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 . /etc/sysconfig/network
21 [ -f /etc/sysconfig/c-icap ] && . /etc/sysconfig/c-icap
23 # Default pidfile location
24 c_icap_pidfile="/var/run/c-icap/c-icap.pid"
26 # Check that networking is up.
27 if is_yes "${NETWORKING}"; then
28 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
29 msg_network_down c-icap
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/c-icap ]; then
40 daemon /usr/bin/c-icap
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/c-icap
44 msg_already_running c-icap
49 if [ -f /var/lock/subsys/c-icap ]; then
52 killproc --pidfile $c_icap_pidfile c-icap
53 rm -f /var/lock/subsys/c-icap >/dev/null 2>&1
55 msg_not_running c-icap
60 # if service is up, do configtest
61 if [ -f /var/lock/subsys/c-icap ]; then
62 if [ $RETVAL != 0 ]; then
71 # if service is up, do configtest
72 if [ -f /var/lock/subsys/c-icap ]; then
73 if [ $RETVAL != 0 ]; then
79 msg_not_running c-icap
85 # See how we were called.
103 status --pidfile $c_icap_pidfile c-icap
107 msg_usage "$0 {start|stop|init|restart|try-restart|reload|force-reload|status}"