diff --git a/rebuild-hosts.allow.sh b/rebuild-hosts.allow.sh index e962883..c27448b 100755 --- a/rebuild-hosts.allow.sh +++ b/rebuild-hosts.allow.sh @@ -6,7 +6,14 @@ # 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 @@ -55,6 +62,10 @@ # 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}" @@ -77,12 +88,6 @@ cat ${PROLOGUE} - -# Delete the user requests - -rm -rf ${USERREQUESTS} - - # Now include the standard set of access definitions echo ""