#!/bin/sh

PKGPATH="/etc/iscan/pkg"
GIFPATH="/is-images/"
SMTPD="/etc/iscan/sendmail"
FTPD="/etc/iscan/isftpd"
HTTPD="/etc/iscan/ishttpd"
CVP="/etc/iscan/iscvp"
INIFILE="/etc/iscan/intscan.ini"
GETENGPG="./geteng"
INSTPKG=0

pv=`grep "^ProductNAMEVER" $INIFILE | tail -1 | cut -d= -f2`
echo "Content-Type: text/html"
echo
echo
echo "<html><head><title> InterScan Information </title></head>"
echo "<font size=2 face=Arial, Sans-serif>"
echo "<BODY BGCOLOR=#FFFFFF LINK=#FFB573 VLINK=#00A5C6 ALINK=#C6EFF7>"
echo "<H4><FONT COLOR=#083194>About</FONT></H4>"
echo "<BR>"
echo "<B><font color=\"#000000\">InterScan</font> "
echo "v${pv} is an Internet virus scanning package.</B>"
echo "<UL>"
echo "Version Information :<BR>"
echo "<UL>"
echo "<TABLE BORDER=0>"
if [ -x $GETENGPG ] ; then
  echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>"
  $GETENGPG "Scan Engine:"
  echo "</font>"  
  echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>"
  $GETENGPG "Pattern Number: "
  echo "</font>"  
fi

test -f $PKGPATH/ISSMTP && test -x $SMTPD 
if  [ "$?" = "0" ] ; then
  #sversion=`strings /etc/iscan/sendmail | egrep 'Version [0-9.0-9]' | awk '{print $2}'| head -1` 
  sversion=`/etc/iscan/sendmail -v | cut -d' ' -f2`
   echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>SMTP version: $sversion<BR></font>"

fi

test -f $PKGPATH/ISFTP && test -x $FTPD 
if [ "$?" = "0" ] ; then
  #sversion=`strings /etc/iscan/isftpd | egrep 'Version [0-9.0-9]' | awk '{print $2}'| head -1` 
  sversion=`/etc/iscan/isftpd -v | cut -d' ' -f2`

  echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>FTP version: $sversion<BR></font>"
fi

test -f $PKGPATH/ISHTTP && test -x $HTTPD 
if [ "$?" = "0" ] ; then
  #sversion=`strings /etc/iscan/ishttpd | egrep 'Version [0-9.0-9]' | awk '{print $2}'| head -1`
  sversion=`/etc/iscan/ishttpd -v | cut -d' ' -f2`

  echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>HTTP version: $sversion<BR></font>"

fi

test -f $PKGPATH/ISCVP && test -x $CVP 
if [ "$?" = "0" ] ; then
  sversion=`/etc/iscan/iscvp -v | cut -d' ' -f2`

  echo "<TR><TD ALIGN=LEFT><font size=2 face=Arial, Scans-Serif>CVP version: $sversion<BR></font>"

fi
  echo "</TABLE>"
  echo "</UL></UL>"
  echo "</font>"
echo "</BODY> </HTML>"
cat /etc/iscan/eoiscan.input
