diff options
| author | Joe Carstairs <s1806931@ed.ac.uk> | 2026-07-01 15:46:05 +0100 |
|---|---|---|
| committer | Joe Carstairs <s1806931@ed.ac.uk> | 2026-07-01 15:46:05 +0100 |
| commit | c1096e2b0116acc7dd303bae8d4c4e0fad310ba6 (patch) | |
| tree | 5c358dbf65c78f4c7671c05ee9b8e402992c21fc /nginx.mk | |
| parent | 04e1dad95248a45aa864e084ffcbeda24fdf0ef3 (diff) | |
pulls out nginx.mk
Diffstat (limited to 'nginx.mk')
| -rw-r--r-- | nginx.mk | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nginx.mk b/nginx.mk new file mode 100644 index 0000000..8ae9076 --- /dev/null +++ b/nginx.mk @@ -0,0 +1,28 @@ +.PHONY: install_nginx +install_nginx: $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG) + +.PHONY: reinstall_nginx +reinstall_nginx: $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG) + +.PHONY: uninstall_nginx +uninstall_nginx: uninstall_dyndns +ifeq ($(shell test -d $(NGINX_CONFIG_BACKUP) && echo 1 || echo 0),0) + $(warn No nginx backup config detected: doing nothing) +else + sudo mv $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG) + $(RESTART_NGINX) +endif + +$(NGINX_CONFIG_BACKUP): + sudo mv $(NGINX_CONFIG) $(NGINX_CONFIG_BACKUP) + +$(NGINX_CONFIG): $(NGINX_CONFIG_SRC) $(NGINX_CONFIG_BACKUP) + sudo cp $< $@ + $(RESTART_NGINX) + +/etc/nginx/http.d/%joeac.net.conf: nginx/http.d/%joeac.net.conf /etc/nginx/http.d $(NGINX_CONFIG) + sudo cp $< $@ + $(RESTART_NGINX) + +/etc/nginx/http.d: + sudo mkdir -p /etc/nginx/http.d |
