A more elegant fix for empty blacklist file

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5174 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-30 19:05:21 +00:00
parent 8558d49676
commit 76e2eefc48

View File

@ -1096,7 +1096,7 @@ compile_refresh_firewall()
save_command progress_message2 \"Refreshing Black List...\"
run_iptables -F blacklst
save_command load_blacklist
[ -s ${TMP_DIR}/blacklist ] && save_command load_blacklist
INDENT="$indent"
save_command "fi"
@ -3297,6 +3297,8 @@ process_blacklist()
local disposition=$BLACKLIST_DISPOSITION
local f=$(find_file blacklist)
if [ -s $TMP_DIR/blacklist ]; then
[ "$disposition" = REJECT ] && disposition=reject
progress_message2 "Compiling $f..."
@ -3310,18 +3312,14 @@ load_blacklist()
__EOF__
INDENT=" "
if [ -s $TMP_DIR/blacklist ]; then
while read networks protocol ports; do
process_blacklist_rec
done < $TMP_DIR/blacklist
else
save_command true
fi
INDENT=
save_command "}"
save_command
fi
}
#