shorewall_code/Shorewall/Makefile

26 lines
548 B
Makefile
Raw Normal View History

#
# Shorewall -- /etc/shorewall/Makefile
#
# Reload Shorewall if config files are updated.
# If reloading fails, restore old settings.
SWBIN ?= /sbin/shorewall -q
CONFDIR ?= /etc/shorewall
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
2009-08-23 19:43:01 +02:00
clean:
2009-08-23 21:55:29 +02:00
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~