Added explanatory comments to the BuildEntries() Function
1 parent 83bea77 commit 66ca331dce657d3f0adafcb5fb6529664c0cfae8
@tundra tundra authored on 3 May 2006
Showing 1 changed file
View
12
rebuild-hosts.allow.sh
#
# Copyright (c) 2006 TundraWare Inc., Des Plaines, IL USA
# All Rights Reserved
 
RCSID='$Id: rebuild-hosts.allow.sh,v 1.103 2006/05/03 06:24:24 tundra Exp $'
RCSID='$Id: rebuild-hosts.allow.sh,v 1.104 2006/05/03 06:39:56 tundra Exp $'
 
BASE="/usr/local/etc/tperimeter"
EPILOGUE=${BASE}/epilogue
PROLOGUE=${BASE}/prologue
#####
 
BuildEntries()
{
if [ -d $1 ] # Only attempt this if the target directory exists
if [ -d $1 ] # Only attempt this if the allow/deny directory exists
then
cd $1
for x in *
do
if [ $x != '*' ]
if [ $x != '*' ] # Only if there are services specified therein
then
cd $x
list=""
for y in *
do
if [ $y != '*' ]
if [ $y != '*' ] # Only create list if actual addresses are present
then
list=${list}${y}" "
fi
done
if [ "$list" ]
if [ "$list" ] # Output complete rule for all non-empty address lists
then
echo "$x: $list :$2"
fi
cd ..
fi
done
fi
}
 
# End Of 'BuildEntries()'
 
 
#####
# Rebuild /etc/hosts-allow
#####