#!/bin/sh #------------------------------------------------------------------------------ # /usr/local/htdocs/syslog.cgi - show the syslog file # # Copyright (c) 2003-2010 Marcus Herleb, info(at)herleb(dot).de # Copyright (c) 2011-2024 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2001-02-24 tg # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.. #------------------------------------------------------------------------------ #exec 2> /tmp/mini-syslog-trace$$.log #set -x SEC_REALM='logs' SEC_ACTION='view' . ./sec-lib.cgi # Parse variables... eval "`proccgi $*`" echo "Content-Type: text/html; charset=iso-8859-1" echo "Cache-control: no-store" # HTTP/1.1 (or no-cache?) echo "Pragma: no-cache" # HTTP/1.0 echo "Expires: `date -Ru`" # Expires now! echo echo '' echo '' echo 'Syslog' echo '' # disable pathname expansion set -f if [ -z "$FORM_target" ] then FORM_target='*.*' fi if [ ! -f /etc/syslog.conf ] then echo "

Error

No Syslog installed!" exit 1 fi for FNAME in `grep "${FORM_target}" /etc/syslog.conf | cut -d' ' -f2` do if [ -f ${FNAME} ] then printout=${FNAME} break fi done if [ ! -f "${printout}" ] then printout='' fi # enable pathname expansion set +f if [ -z "$printout" ] then echo "

Error

No file for Syslog-Target $FORM_target found!" exit 1 fi echo "

Syslog

File: $printout ($FORM_target)

"
echo ''
echo '
' exit 0