From 67a1438a41805c45f613b019e9e30d165d00af9b Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 1 Mar 2012 06:41:06 -0800 Subject: [PATCH] Tweak /sbin/shorewall-init 1) Make indentation consistent 2) Remove IPSET_SAVE logic Signed-off-by: Tom Eastep --- Shorewall-init/shorewall-init | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/Shorewall-init/shorewall-init b/Shorewall-init/shorewall-init index d73bbcd6f..1d41dd349 100644 --- a/Shorewall-init/shorewall-init +++ b/Shorewall-init/shorewall-init @@ -30,17 +30,15 @@ then fi # check if shorewall-init is configured or not -if [ -f "/etc/sysconfig/shorewall-init" ] -then - . /etc/sysconfig/shorewall-init - if [ -z "$PRODUCTS" ] - then - echo "ERROR: No products configured" >&2 - exit 1 - fi -else - echo "ERROR: /etc/sysconfig/shorewall-init not found" >&2 +if [ -f "/etc/sysconfig/shorewall-init" ]; then + . /etc/sysconfig/shorewall-init + if [ -z "$PRODUCTS" ]; then + echo "ERROR: No products configured" >&2 exit 1 + fi +else + echo "ERROR: /etc/sysconfig/shorewall-init not found" >&2 + exit 1 fi # Initialize the firewall @@ -59,10 +57,6 @@ shorewall_start () { fi done - if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then - ipset -R < "$SAVE_IPSETS" - fi - return 0 } @@ -80,13 +74,6 @@ shorewall_stop () { fi done - if [ -n "$SAVE_IPSETS" ]; then - mkdir -p $(dirname "$SAVE_IPSETS") - if ipset -S > "${SAVE_IPSETS}.tmp"; then - grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" - fi - fi - return 0 }