#!/bin/csh
#
# (c) Copyright 1993-1997 Check Point Software Technologies Ltd.
# All rights reserved.
# 
# This is proprietary information of Check Point Software Technologies
# Ltd., which is provided for informational purposes only and for use
# solely in conjunction with the authorized use of Check Point Software
# Technologies Ltd. products.  The viewing and use of this information is
# subject, to the extent appropriate, to the terms and conditions of the
# license agreement that authorizes the use of the relevant product.
#
# $Header: /fw/cvs/fw-1/fwutil/status_alert.csh,v 1.6.2.1 1997/02/19 16:52:22 dorit Exp $
#
set input = $<
set inp = ( $input )
set more
set new=unknown
set old=unknown
set date
set timex
set host=unknown_host

while ($#inp)
	switch ($inp[1])
		case "date=*":
			set date = `echo $inp[1] | sed 's/date=//'`
			breaksw
		case "time=*":
			set timex = `echo $inp[1] | sed 's/time=//'`
			breaksw
		case "hostname=*":
			set host = `echo $inp[1] | sed 's/hostname=//'`
			breaksw
		case "old=*":
			set old = `echo $inp[1] | sed 's/old=//'`
			breaksw
		case "new=*":
			set new = `echo $inp[1] | sed 's/new=//'`
			breaksw
		default:
			set more = "$more $inp[1]"
			breaksw
	endsw
	shift inp
end
echo "" $date $timex status ${host}: " " switching from old state \'$old\' \
				to new state \'$new\' $more |\
	fwalert
