From 1c921c9f5597e1ae31acf225d7cbca2f97e5051c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 25 Jan 2014 13:36:05 +0000 Subject: [PATCH] Makefile: Verify configurations before installing them. Since we can't always verify them at the origin, this seems like an important way of avoiding screwing things up badly. --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b290a59..341208e 100644 --- a/Makefile +++ b/Makefile @@ -94,14 +94,19 @@ OTHERHOSTS = $(filter-out $(THISHOST), $(HOSTS)) ROOT = sudo +install_rune = \ + exim4 -C/etc/exim4/exim4.conf.new -bV >/dev/null && \ + mv /etc/exim4/exim4.conf.new /etc/exim4/exim4.conf && \ + service exim4 reload + install/$(THISHOST): exim4-$(call host-mode,$(THISHOST)).conf - $(ROOT) install -m644 $< /etc/exim4/exim4.conf - $(ROOT) service exim4 reload + $(ROOT) cp $< /etc/exim4/exim4.conf.new + $(ROOT) sh -c '$(install_rune)' $(addprefix install/, $(OTHERHOSTS)): \ install/%: exim4-$$(call host-mode,$$*).conf - $(ROOT) scp $< root@$*:/etc/exim4/exim4.conf - $(ROOT) ssh root@$* service exim4 reload + $(ROOT) scp $< root@$*:/etc/exim4/exim4.conf.new + $(ROOT) ssh root@$* '$(install_rune)' install: $(addprefix install/, $(HOSTS)) -- 2.11.0