File: fetch-crl-boot.init

package info (click to toggle)
fetch-crl 2.8.5-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 160 kB
  • ctags: 15
  • sloc: sh: 914; makefile: 104
file content (70 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#
# fetch-crl-boot  This shell script enables a run of fetch-crl on boot.
#
# Author:       Steve Traylen <steve.traylen@cern.ch>
#
# chkconfig:	- 50 01
#
# description:  Run of fetch-crl, a crl updater on boot up
# processname:  fetch-crl
# config: /etc/fetch-crl.conf
#

# source function library
. /etc/rc.d/init.d/functions

lockfile=/var/lock/subsys/fetch-crl-boot

RETVAL=0

start() {
	action $"Running fetch-crl on boot can take a while: " /usr/sbin/fetch-crl  -a 24 --quiet
	RETVAL=$?
	[ "$RETVAL" = 0 ] && touch $lockfile
}

stop() {
	RETVAL=0
	[ "$RETVAL" = 0 ] && rm -f $lockfile
}

restart() {
	stop
	start
}

case "$1" in
  start)
	start
	;;
  stop) 
	stop
	;;
  restart|force-reload)
	restart
	;;
  condrestart)
        if [ -f $lockfile ]  ; then
           stop
           start
        fi
        ;;
  reload)
	;;
  status)
         if [ -f $lockfile ]  ; then
           echo -n $"fetch-crl-boot lockfile present" && success
           RETVAL=0
         else
           echo -n $"fetch-crl-boot lockfile not-present" && failure
           RETVAL=1
         fi
         echo
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
	exit 1
esac

exit $RETVAL