#!/bin/sh
#
# fetch-crl-boot  This shell script trigger a run of fetch-crl at boot time
# 2011-05-19 ported to openSUSE by Sven Uebelacker <sven@uebelacker.net>
#
# /etc/init.d/fetch-crl-boot
#
#   and symbolic its link
#
# /usr/bin/rcfetch-crl-boot
#
### BEGIN INIT INFO
# Provides:          fetch-crl-boot
# Required-Start:    $network $syslog $remote_fs
# Required-Stop:     $network $syslog $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Run of fetch-crl, a crl updater, on boot up
# Description:       Run of fetch-crl, a crl updater, on boot up
### END INIT INFO

# source function library
. /etc/rc.status

# source any environment settings, e.g. for HTTP proxies
[ -f /etc/sysconfig/fetch-crl ] && . /etc/sysconfig/fetch-crl

lockfile="/var/lock/subsys/fetch-crl-boot"
fetchcrl_bin="/usr/sbin/fetch-crl"

rc_reset
case "$1" in
	start)
		echo -n "Running fetch-crl on boot "
		startproc ${fetchcrl_bin} -q
		rc_status -v
		touch ${lockfile}
		;;
	stop) 
		echo -n "Removing lockfile for fetch-crl on boot "
		rm -f ${lockfile}
		rc_status -v
		;;
	restart|reload)
		$0 stop
		$0 start
		rc_status
		;;
	status)
		echo -n "Status of fetch-crl-boot lockfile "
		test -f $lockfile
		rc_status -v
		;;
	*)
		echo "Usage: $0 {start|stop|status|restart|reload)"
		exit 1
		;;
esac
rc_exit
