From: Mark Wooding Date: Sun, 22 May 2011 22:25:59 +0000 (+0100) Subject: local.mk: Introduce new target for testing. X-Git-Url: https://git.distorted.org.uk/~mdw/firewall/commitdiff_plain/eb4cb6714854decd932f1a495794cd70139fb151 local.mk: Introduce new target for testing. This avoids trashing other hosts with maybe broken firewalls. --- diff --git a/local.mk b/local.mk index 1a02711..df5e26d 100644 --- a/local.mk +++ b/local.mk @@ -4,15 +4,20 @@ MAIN_M4_SOURCES += local.m4 HOSTS += metalzone HOSTS += vampire +THISHOST = $(shell hostname) -ROOT = become root +ROOT = sudo -## Installation. -install: all - firewall_script=./`hostname`.sh && \ +## Testing. +check: $(THISHOST).sh + firewall_script=./$(THISHOST).sh && \ firewall_failsafe=/etc/init.d/firewall && \ export firewall_script firewall_failsafe && \ + [ -x $$firewall_failsafe ] && \ $(ROOT) ./$$firewall_script + +## Installation. +install: all check for i in $(HOSTS); do \ $(ROOT) scp $$i.sh $$i:/etc/init.d/firewall; \ if [ "$(SCRIPTS)" ]; then \