#!/bin/bash
export PATH="/bin:/sbin/:/usr/bin:/usr/sbin"
#Copyright 2001 William Stearns
#Released under the GPL.
#Format=ascii|html-pre-bare|html-pre-full-page #html-table-full-page|html-table-bare later
#FIXME - Load settings from the command line or $QUERY_STRING
#Hard code here for testing.
Format=html-pre-full-page
#FIXME - when no fields to submit, it appears QUERY_STRING is blank.
lc () {
echo "$*" | tr A-Z a-z
}
uc () {
echo "$*" | tr a-z A-Z
}
ClearOptions () {
unset SourceAddress SourcePort DestinationAddress DestinationPort Protocol
}
ParseOption () {
ONEVAL=${1##*=}
case $1 in
SourceAddress=*) SourceAddress=$ONEVAL ;;
SourcePort=*) SourcePort=$ONEVAL ;;
DestinationAddress=*) DestinationAddress=$ONEVAL ;;
DestinationPort=*) DestinationPort=$ONEVAL ;;
Protocol=*) Protocol=$ONEVAL ;;
esac
}
GenericHeader () {
case $Format in
html-pre-full-page)
cat <
Firewall blocking rules
EOTEXT
# echo \ ; set | egrep -i '(Source|Destination|Protocol)' ; echo \
;;
esac
case $Format in
html-pre-*)
echo ''
;;
esac
}
GenericFooter () {
case $Format in
html-pre-*)
echo '
'
;;
esac
case $Format in
html-pre-full-page)
cat <Please enter the IP and/or port(s) you wish to block. Any of the
following may be left blank; blank addresses will be treated as
"Any address" and blank ports will be treated as "Any port".
Created by the blockrules program. See
http://www.stearns.org
for more information about this tool and updated versions.