#!/bin/bash
# $Header: /cvs/WebShield/wsrc/files/mgmt/systemservices.d/10_cronconf,v 1.2 2004/02/02 14:19:16 bwhittak Exp $
#
# Copyright (C) 2004 Networks Associates Technology Inc. All Rights Reserved
#
if [ -f $NETAWSS/.profile.vars ]; then
 . $NETAWSS/.profile.vars
else
 . /var/NAIENV/.profile.vars
fi
PATH=$wsPATH:$PATH
option=${1}

systemconf=$XMLCONFDIR/system.xml

exec </dev/null		# whatever stdin is we don't want it

# not much point if there's no XML config
[[ -f "$systemconf" ]] || exit 1

write_crontab()
{
    # Setup the updaters
    xsltproc ${WSMGMT}/ws_system_cron.xsl $systemconf \
	> /etc/cron.d/webshield_system.cron
    touch /etc/cron.d	# tell cron to look again
}

case $option in
    (start|restart|reload) write_crontab ;;
    (stop|status) : ;;
    (*) echo $"Usage: $0 {start|stop|restart|reload|status}"; exit 1 ;;
esac

exit 0

