1 |
davidg |
1758 |
#!/bin/sh |
2 |
|
|
# |
3 |
|
|
# fetch-crl-cron This shell script enables periodic CRL retrieval via cron |
4 |
|
|
# |
5 |
|
|
# chkconfig: - 65 01 |
6 |
|
|
# |
7 |
|
|
# description: Run the certificate revocation lists update periodically via cron |
8 |
|
|
# processname: fetch-crl-cron |
9 |
|
|
# config: /etc/fetch-crl.conf |
10 |
|
|
# |
11 |
|
|
|
12 |
|
|
# source function library |
13 |
|
|
. /etc/rc.d/init.d/functions |
14 |
|
|
|
15 |
|
|
lockfile=/var/lock/subsys/fetch-crl-cron |
16 |
|
|
|
17 |
|
|
RETVAL=0 |
18 |
|
|
|
19 |
|
|
start() { |
20 |
|
|
action $"Enabling periodic fetch-crl: " touch "$lockfile" |
21 |
|
|
RETVAL=$? |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
stop() { |
25 |
|
|
action $"Disabling periodic fetch-crl: " rm -f "$lockfile" |
26 |
|
|
RETVAL=$? |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
case "$1" in |
30 |
|
|
start) |
31 |
|
|
start |
32 |
|
|
;; |
33 |
|
|
stop) |
34 |
|
|
stop |
35 |
|
|
;; |
36 |
|
|
restart|force-reload) |
37 |
|
|
$0 stop |
38 |
|
|
$0 start |
39 |
|
|
;; |
40 |
|
|
reload) |
41 |
|
|
;; |
42 |
|
|
condrestart) |
43 |
|
|
[ -f "$lockfile" ] && { |
44 |
|
|
$0 stop |
45 |
|
|
$0 start |
46 |
|
|
} |
47 |
|
|
;; |
48 |
|
|
status) |
49 |
|
|
if [ -f $lockfile ]; then |
50 |
|
|
echo $"Periodic fetch-crl is enabled." |
51 |
|
|
RETVAL=0 |
52 |
|
|
else |
53 |
|
|
echo $"Periodic fetch-crl is disabled." |
54 |
|
|
RETVAL=3 |
55 |
|
|
fi |
56 |
|
|
;; |
57 |
|
|
*) |
58 |
|
|
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" |
59 |
|
|
exit 1 |
60 |
|
|
esac |
61 |
|
|
|
62 |
|
|
exit $RETVAL |