Updated to only delete outstanding requests older than $DURATION (default: 10 min).
This allows the script to be run as often as possible because the duration of access
is separated from the frequency of how often the script is run.
1 parent dad53c1 commit 1cb9b848ed2c240f4a38f802aa267f6a0ca329e7
@tundra tundra authored on 13 Jan 2012
Showing 1 changed file
View
26
rebuild-hosts.allow.sh
#
# Copyright (c) 2006 TundraWare Inc., Des Plaines, IL USA
# All Rights Reserved
 
RCSID='$Id: rebuild-hosts.allow.sh,v 1.106 2008/10/20 20:25:24 tundra Exp $'
RCSID='$Id: rebuild-hosts.allow.sh,v 1.107 2012/01/13 22:39:31 tundra Exp $'
 
# How long should access remain open?
# This must be in the format used by the 'find -ctime' option
 
DURATION=10m
 
# File locations
 
BASE="/usr/local/etc/tperimeter"
EPILOGUE=${BASE}/epilogue
PROLOGUE=${BASE}/prologue
#####
# Rebuild /etc/hosts-allow
#####
 
# Before we do this, delete the user requests older than $DURATAION
 
find ${USERREQUESTS} -type f -ctime +${DURATION} -exec rm {} \;
 
# Timestamp it
 
echo "# Built By: ${RCSID}"
echo "# Built On: `date`"
# Now, the standard prologue
 
cat ${PROLOGUE}
 
 
# Delete the user requests
 
rm -rf ${USERREQUESTS}
 
 
# Now include the standard set of access definitions
 
echo ""
echo "# Standard 'Deny' Entries"