1 |
#!/bin/sh |
2 |
# |
3 |
# fetch-crl-boot This shell script trigger a run of fetch-crl at boot time |
4 |
# |
5 |
# chkconfig: - 65 01 |
6 |
# |
7 |
# description: Run of fetch-crl, a crl updater, on boot up |
8 |
# processname: fetch-crl |
9 |
# config: /etc/fetch-crl.conf |
10 |
# config: /etc/sysconfig/fetch-crl |
11 |
# |
12 |
|
13 |
# fetch-crl-boot must run after the start of xinetd and afs, since the URLs |
14 |
# may point to files on an AFS file system or to xinetd-based service URLs |
15 |
|
16 |
# source function library |
17 |
. /etc/rc.d/init.d/functions |
18 |
|
19 |
# source any environment settings, e.g. for HTTP proxies |
20 |
[ -f /etc/sysconfig/fetch-crl ] && . /etc/sysconfig/fetch-crl |
21 |
|
22 |
lockfile=/var/lock/subsys/fetch-crl-boot |
23 |
|
24 |
RETVAL=0 |
25 |
|
26 |
start() { |
27 |
if [ ! -f $lockfile ]; then |
28 |
action $"Running fetch-crl on boot: " /usr/sbin/fetch-crl -q $FETCHCRL_OPTIONS $FETCHCRL_BOOT_OPTIONS |
29 |
RETVAL=$? |
30 |
[ "$RETVAL" = 0 -o "$RETVAL" = 2 ] && touch $lockfile |
31 |
else |
32 |
RETVAL=0 |
33 |
fi |
34 |
} |
35 |
|
36 |
stop() { |
37 |
RETVAL=0 |
38 |
[ "$RETVAL" = 0 ] && rm -f $lockfile |
39 |
} |
40 |
|
41 |
case "$1" in |
42 |
start) |
43 |
start |
44 |
;; |
45 |
stop) |
46 |
stop |
47 |
;; |
48 |
restart|force-reload) |
49 |
$0 stop |
50 |
$0 start |
51 |
;; |
52 |
condrestart) |
53 |
[ -f $lockfile ] && { |
54 |
$0 stop |
55 |
$0 start |
56 |
} |
57 |
;; |
58 |
reload) |
59 |
;; |
60 |
status) |
61 |
if [ -f $lockfile ] ; then |
62 |
echo -n $"fetch-crl-boot lockfile present" && success |
63 |
RETVAL=0 |
64 |
else |
65 |
echo -n $"fetch-crl-boot lockfile missing" && failure |
66 |
RETVAL=1 |
67 |
fi |
68 |
echo |
69 |
;; |
70 |
*) |
71 |
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" |
72 |
exit 1 |
73 |
esac |
74 |
|
75 |
exit $RETVAL |