pulls out uninstall to openrc.mk
This commit is contained in:
@@ -23,7 +23,6 @@ MAKE_MODULES := $(foreach module,$(MODULES),\
|
|||||||
# FUNCTIONS #
|
# FUNCTIONS #
|
||||||
#############
|
#############
|
||||||
|
|
||||||
openrc_module_target = $(if $(filter $(COMPOSE_SERVICES),$(module)),~/.config/rc/init.d/joeac.net.$(module))
|
|
||||||
install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk")
|
install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk")
|
||||||
|
|
||||||
define make_module_rule =
|
define make_module_rule =
|
||||||
@@ -51,12 +50,7 @@ endef
|
|||||||
|
|
||||||
define uninstall_module_rule =
|
define uninstall_module_rule =
|
||||||
.PHONY: uninstall_$(module)
|
.PHONY: uninstall_$(module)
|
||||||
uninstall_$(module):
|
uninstall_$(module): uninstall_openrc_$(module)
|
||||||
$(if $(openrc_module_target),\
|
|
||||||
rc-service -U joeac.net.$(module) stop \
|
|
||||||
rc-update -U del joeac.net.$(module) default \
|
|
||||||
rm ~/.config/rc/init.d/joeac.net.$(module) \
|
|
||||||
)
|
|
||||||
$(if $(SUBDOMAIN_$(module)),\
|
$(if $(SUBDOMAIN_$(module)),\
|
||||||
sudo rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf; \
|
sudo rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf; \
|
||||||
$(RESTART_NGINX); \
|
$(RESTART_NGINX); \
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
is_openrc_module = $(filter $(COMPOSE_SERVICES),$(module))
|
||||||
|
openrc_module_target = $(if $(is_openrc_module),~/.config/rc/init.d/joeac.net.$(module))
|
||||||
|
|
||||||
define install_openrc_module_rule =
|
define install_openrc_module_rule =
|
||||||
.PHONY: install_openrc_$(module)
|
.PHONY: install_openrc_$(module)
|
||||||
install_openrc_$(module): $(openrc_module_target) openrc_add_$(module) openrc_start_$(module)
|
install_openrc_$(module): $(openrc_module_target) openrc_add_$(module) openrc_start_$(module)
|
||||||
@@ -8,7 +11,17 @@ endef
|
|||||||
|
|
||||||
define reinstall_openrc_module_rule =
|
define reinstall_openrc_module_rule =
|
||||||
.PHONY: reinstall_openrc_$(module)
|
.PHONY: reinstall_openrc_$(module)
|
||||||
reinstall_openrc_$(module): $(if $(openrc_module_target),$(openrc_module_target) openrc_restart_$(module))
|
reinstall_openrc_$(module): $(if $(is_openrc_module),$(openrc_module_target) openrc_restart_$(module))
|
||||||
|
endef
|
||||||
|
|
||||||
|
define uninstall_openrc_module_rule =
|
||||||
|
.PHONY: uninstall_openrc_$(module)
|
||||||
|
uninstall_openrc_$(module):
|
||||||
|
$(if $(is_openrc_module),\
|
||||||
|
rc-service -U joeac.net.$(module) stop; \
|
||||||
|
rc-update -U del joeac.net.$(module) default; \
|
||||||
|
rm ~/.config/rc/init.d/joeac.net.$(module); \
|
||||||
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define openrc_add_rule =
|
define openrc_add_rule =
|
||||||
@@ -31,6 +44,7 @@ endef
|
|||||||
|
|
||||||
$(foreach module,$(MODULES),$(eval $(install_openrc_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(install_openrc_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(reinstall_openrc_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(reinstall_openrc_module_rule)))
|
||||||
|
$(foreach module,$(MODULES),$(eval $(uninstall_openrc_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_add_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_add_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_start_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_start_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_restart_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_restart_rule)))
|
||||||
|
|||||||
Reference in New Issue
Block a user