#!/bin/sh
# 
# @DEC_COPYRIGHT@
#
# HISTORY
# $Log: syslog_details.sh,v $
# Revision 1.1.1.1  2003/12/11 15:40:53  ajay
# Importing Evm sources.
#
# Revision 1.1.1.1  2002/09/12 15:44:00  lsn
# EVM source - Linux initial version
#
# Revision 1.1.10.1  2001/11/21  21:15:33  Jem_Treadwell
# Merge Information:  Non-Visual Merge: User specified revision 1.1.8.1
#     User Revision:  v51asupportos_bl0:1.1.4.6 Local Ancestor: n/a
#    Merge Revision:  1.1.8.1
#   Common Ancestor:  1.1.4.6
# 	Merge tempfile changes from wildcat to wcalpha
#
# Revision 1.1.8.1  2001/06/27  19:18:09  Jem_Treadwell
# 	QAR 87148: Create tempfile securely
# 
# Revision 1.1.4.6  1999/04/27  20:08:25  Bruce_Gayliard
# 	Fix for QAR 71164 - use sh, not ksh, to execute script.
# 	[1999/04/26  19:23:28  Bruce_Gayliard]
# 
# Revision 1.1.4.5  1997/11/20  22:38:17  Bruce_Gayliard
# 	BL 14 drop from EVM shared sandbox.
# 	[1997/11/19  21:22:42  Bruce_Gayliard]
# 
# Revision 1.1.2.5  1997/10/24  18:16:49  Jem_Treadwell
# 	Cleanup temp files
# 	[1997/10/24  18:12:50  Jem_Treadwell]
# 
# Revision 1.1.2.4  1997/10/07  20:43:20  Jem_Treadwell
# 	Cleanup: report errors to stdout and fix a typo
# 	[1997/10/07  20:42:32  Jem_Treadwell]
# 
# Revision 1.1.2.3  1997/09/08  19:04:49  Bruce_Gayliard
# 	Fixes for LINUX / portability.
# 	[1997/09/08  19:01:44  Bruce_Gayliard]
# 
# Revision 1.1.2.2  1997/07/26  14:48:36  Jem_Treadwell
# 	Initial submit
# 	[1997/07/26  14:47:50  Jem_Treadwell]
# 
# 
# $EndLog$
# 
# @(#)$RCSfile: syslog_details.sh,v $ $Revision: 1.1.1.1 $ (DEC) $Date: 2003/12/11 15:40:53 $
# 

. /usr/sbin/evmcommandset

USAGE="Usage: $0"

EXIT_OK=0
EXIT_USAGE=1
EXIT_TEMPFILE=2

while [ $# -gt 0 ]
do
	case $1 in
	*)	${ECHO} $USAGE >&2
		exit $EXIT_USAGE
		;;
	esac
done

# Create a secure tempfile.  EVM_MKSTEMP is defined
# in evmcommandset.
MYNAME=`basename $0`
TEMPFILE=`EVM_MKSTEMP $MYNAME`
if [ "$TEMPFILE" = "" ]
then
    exit $EXIT_TEMPFILE
fi

# Clean up on exit or interruption:
trap "${RM} -f $TEMPFILE; exit" 0 2

# Save the input event stream into a tempfile:
${CAT} >> $TEMPFILE

${ECHO} ============================ Syslog event ============================ 
/usr/bin/evmshow -n 1 -t "EVM event name: @name" < $TEMPFILE 2>&1
${ECHO}
/usr/bin/evmshow -n 1 -x < $TEMPFILE 2>&1
${ECHO} ====================================================================== 
eval /usr/bin/evmshow -n 1 -D $FILTER  < $TEMPFILE 2>&1
${ECHO}
${ECHO} ====================================================================== 
${ECHO}

${RM} -f $TEMPFILE
exit $?
