#! /usr/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#  
# ident	"%Z%%M%	%I%	%E% SMI"
#

# cgi script to handle bootlog messages
#   formats the message:
#             replaces <time> placemarker by local time
#             removes '\' inserted by cgi gateway
#   writes the message to a log file

BOOTLOG_PATH="/tmp/"
BOOTLOG_FILE_PREFIX="bootlog"
hostname=$2

# disable filename globbing
set -f

bootlog_file=${BOOTLOG_PATH}${BOOTLOG_FILE_PREFIX}.$hostname

# write date in bootlog format
echo "`date '+%b %d %H:%M:%S'` \c" >> $bootlog_file
# remove backslashes inserted by CGI gateway
# and remove time placeholder
echo $* | sed 's/\\//g;s/<time>//g'  >> $bootlog_file

# Do not change these lines vvv
echo Content-type: text/plain
echo Content-length: 32
echo

echo CGI/1.0 bootlog script report:
echo
# Do not change these lines ^^^

