#!/bin/sh
#
# (C) R. J. Livermore  1995-2000
# (C) Livermore Software Laboratories, Inc. 1995-2000
#
# NOTICE TO USERS OF SOURCE CODE EXAMPLES
#
# FAS PROVIDES THE SOURCE CODE EXAMPLES, "AS IS" WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE
# ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOURCE CODE EXAMPLES
# IS WITH YOU.  SHOULD ANY PART OF THE SOURCE CODE PROVE DEFECTIVE, YOU
# (AND NOT FAS OR AGENT OF FAS) ASSUME THE ENTIRE COST OF ALL NECESSARY
# SERVICING, REPAIR OR CORRECTION.
#
# file:  /usr/local/etc/refresh_webgate
#
# This script kills and restarts /usr/local/etc/webgate
# and rotates the log /home/hermes/http.access.log
# appending the date to the name of the rotated log.
#
# cron can be configured to automate the script.  To do so,
# insert a line at the bottom of /usr/spool/cron/crontabs/root specifying
# the download script and the time and date of download.  The first numer
# in a cron statement is minutes, the second is hours in military time, the 
# fifth is the day of the week, and everything after the day of the week
# is executed.  See example.
# example:
#		43 2 * * 1 /usr/local/etc/refresh_webgate
#
kill `cat /etc/firewall/webgate.pid`
sleep 10 
mv /home/hermes/http.access.log /home/hermes/http.access.log.`date +%y%m%d`
/usr/local/etc/webgate
