#!/bin/sh
#
# fetch-crl-cron  This shell script enables periodic CRL retrieval via cron
# 2011-05-19 ported to openSUSE by Sven Uebelacker <sven@uebelacker.net>
#
# /etc/init.d/fetch-crl-cron
#
#   and symbolic its link
#
# /usr/bin/rcfetch-crl-cron
#
### BEGIN INIT INFO
# Provides:          fetch-crl-cron
# 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 the certificate revocation lists update periodically via cron
# Description:       Run the certificate revocation lists update periodically via cron
### 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-cron"

rc_reset
case "$1" in
	start)
		echo -n "Enabling periodic fetch-crl: "
		touch "${lockfile}"
		rc_status -v
		;;
	stop) 
		echo -n "Disabling periodic fetch-crl: "
		rm -f "${lockfile}"
		rc_status -v
		;;
	restart|reload)
		$0 stop
		$0 start
		rc_status
		;;
	status)
		echo -n "Periodic fetch-crl is "
		test -f "${lockfile}"
		rc_status -v
		;;
	*)
		echo "Usage: $0 {start|stop|status|restart|reload}"
		exit 1
		;;
esac
rc_exit
