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 <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-10-10 15:57:48 -07:00
parent 19482ac197
commit a5086f785f

View File

@ -367,6 +367,17 @@ resolve_arptables() {
esac 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 # Save currently running configuration
# #
@ -428,7 +439,7 @@ do_save() {
;; ;;
esac esac
if ! run_it ${VARDIR}/firewall savesets ${g_restorepath}-ipsets; then if ! savesets; then
case ${SAVE_IPSETS:=No} in case ${SAVE_IPSETS:=No} in
[Yy]es) [Yy]es)
case ${IPSET:=ipset} in case ${IPSET:=ipset} in