From 0bdffef40b8d64065a496a93cb19c2b44cc59b53 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 2 Apr 2006 16:18:36 +0000 Subject: [PATCH] Only process /etc/shorewall/rtrules if it is non-empty git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3766 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/compiler | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Shorewall/compiler b/Shorewall/compiler index 74e9bb5a9..e389da027 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -1387,15 +1387,19 @@ __EOF__ f=$(find_file rtrules) if [ -f $f ]; then - progress_message2 "$DOING $f..." - strip_file rtrules $f - while read provider priority source dest; do - expandv priority provider source dest - rule="$priority $provider $source $dest" - add_an_rtrule - done < $TMP_DIR/rtrules + if [ -s $TMP_DIR/rtrules ]; then + progress_message2 "$DOING $f..." + + save_command + + while read provider priority source dest; do + expandv priority provider source dest + rule="$priority $provider $source $dest" + add_an_rtrule + done < $TMP_DIR/rtrules + fi fi fi