wok-6.x view c_icap/stuff/c-icapd @ rev 24491
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 18 22:59:06 2022 +0000 (2022-02-18) |
parents | 0d8a1a3edc72 |
children |
line source
1 #!/bin/sh
2 # /etc/init.d/nagios : Start, stop and restart ICAP server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start ICAP server at boot time, just put c-icapd in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=c-icap
12 DESC="$(_ '%s server' ICAP)"
13 DAEMON=/usr/bin/c-icap
14 OPTIONS=""
15 PIDFILE=/var/run/c-icap/c-icap.pid
17 [ -d /var/run/c-icap ] || mkdir -p /var/run/c-icap
18 case "$1" in
19 start)
20 if active_pidfile $PIDFILE $NAME ; then
21 _ '%s is already running.' $NAME
22 exit 1
23 fi
24 action 'Starting %s: %s...' "$DESC" $NAME
25 $DAEMON $OPTIONS
26 status
27 ;;
28 stop)
29 if ! active_pidfile $PIDFILE $NAME ; then
30 _ '%s is not running.' $NAME
31 exit 1
32 fi
33 action 'Stopping %s: %s...' "$DESC" $NAME
34 kill $(cat $PIDFILE)
35 status
36 ;;
37 restart|reload)
38 if ! active_pidfile $PIDFILE $NAME ; then
39 _ '%s is not running.' $NAME
40 exit 1
41 fi
42 action 'Restarting %s: %s...' "$DESC" $NAME
43 kill $(cat $PIDFILE)
44 sleep 2
45 $DAEMON $OPTIONS
46 status
47 ;;
48 test)
49 configtest ;;
50 *)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart|reload|test]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0