From a5086f785f213e69128a5a26570a9d5624341178 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 10 Oct 2014 15:57:48 -0700 Subject: [PATCH] Avoid confusing output when 4.6.4 CLI executes a 'save' - If a down-rev firewall is running, the savesets command produces confusing usage output Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 28900709a..6b7ad6e5a 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -367,6 +367,17 @@ resolve_arptables() { esac } +# +# Try to run the 'savesets' command +# +savesets() { + local supported + + supported=$(run_it ${VARDIR}/firewall help | fgrep savesets ) + + [ -n "$supported" ] && run_it ${VARDIR}/firewall savesets ${g_restorepath}-ipsets +} + # # Save currently running configuration # @@ -428,7 +439,7 @@ do_save() { ;; esac - if ! run_it ${VARDIR}/firewall savesets ${g_restorepath}-ipsets; then + if ! savesets; then case ${SAVE_IPSETS:=No} in [Yy]es) case ${IPSET:=ipset} in