diff options
| author | Joe Carstairs <me@joeac.net> | 2026-07-01 18:11:08 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-07-01 18:11:08 +0100 |
| commit | c0e6d13a1f3e47aba9d65f605ffeb8365abfda36 (patch) | |
| tree | 179bcd0ea1791f3c85955ac1cf87ac3346c28925 /nginx.mk | |
| parent | 2b00e0399973178ec06b5e43673c0345a6a2895a (diff) | |
moves stuff to nginx.mk
Diffstat (limited to 'nginx.mk')
| -rw-r--r-- | nginx.mk | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -1,11 +1,29 @@ -.PHONY: install_nginx -install_nginx: /etc/nginx/nginx.joeac.net-backup /etc/nginx/nginx.conf +define install_nginx_module_rule = +.PHONY: install_nginx_$(module) +install_nginx_$(module): $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf) +endef -.PHONY: reinstall_nginx -reinstall_nginx: /etc/nginx/nginx.joeac.net-backup /etc/nginx/nginx.conf +define reinstall_nginx_module_rule = +.PHONY: reinstall_nginx_$(module) +reinstall_nginx_$(module): $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf) +endef + +define uninstall_nginx_module_rule = +.PHONY: uninstall_nginx_$(module) +uninstall_nginx_$(module): +endef + +$(foreach module,$(MODULES),$(eval $(install_nginx_module_rule))) + +/etc/nginx/http.d/%.joeac.net.conf: nginx/http.d/%.joeac.net.conf /etc/nginx/http.d /etc/nginx/nginx.conf + sudo cp $< $@ + sudo rc-service nginx restart + +/etc/nginx/http.d: + sudo mkdir -p /etc/nginx/http.d .PHONY: uninstall_nginx -uninstall_nginx: uninstall_dyndns +uninstall_nginx: $(foreach module,$(MODULES),uninstall_nginx_$(module)) ifeq ($(shell test -d /etc/nginx/nginx.joeac.net-backup && echo 1 || echo 0),0) $(warn No nginx backup config detected: doing nothing) else @@ -13,9 +31,9 @@ else sudo rc-service nginx restart endif -/etc/nginx/nginx.joeac.net-backup: - sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.joeac.net-backup - /etc/nginx/nginx.conf: nginx/nginx.conf /etc/nginx/nginx.joeac.net-backup sudo cp $< $@ sudo rc-service nginx restart + +/etc/nginx/nginx.joeac.net-backup: + sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.joeac.net-backup |
