shorewall_code/Shorewall6/Makefile
Tuomo Soini 660ae09f4f shorewall6/Makefile: rewrite the Makefile to match shorewall one
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-02-12 12:20:28 +02:00

26 lines
553 B
Makefile

#
# Shorewall6 -- /etc/shorewall6/Makefile
#
# Reload Shorewall6 if config files are updated.
# If reloading fails, restore old settings.
SWBIN ?= /sbin/shorewall6 -q
CONFDIR ?= /etc/shorewall6
SWSTATE ?= $(shell $(SWBIN) show vardir)/firewall
.PHONY: clean
$(SWSTATE): $(CONFDIR)/*
@$(SWBIN) save >/dev/null; \
RESULT=$$($(SWBIN) reload 2>&1); \
if [ $$? -eq 0 ]; then \
$(SWBIN) save >/dev/null; \
else \
$(SWBIN) restore >/dev/null 2>&1; \
echo "$${RESULT}" >&2; \
false; \
fi
clean:
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~