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