diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b4ac000 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +PKGNAME := netcup-dns + +.PHONY: all +all: install + +.PHONY: install +install: notify cron + sudo python3 -m pip install --upgrade --force-reinstall . + sudo install -m0644 cron.d/$(PKGNAME) /etc/cron.d/$(PKGNAME) + + sudo install --directory -m755 /etc/$(PKGNAME)/ + sudo install -m0644 cfg/* /etc/$(PKGNAME)/ + +.PHONY: notify ## Check if execNotify is installed. +notify: + # `type` does not work e.g. on Ubuntu 18.04 + which de-p1st-execNotify + +.PHONY: cron ## Check if cron (e.g. cronie) is running. +cron: + # Check if cron.d exists + stat /etc/cron.d/ + # Check if cron is running + pgrep cron + +.PHONY: clean +clean: + sudo python3 -m pip uninstall -y $(PKGNAME) + rm -rf /etc/cron.d/$(PKGNAME) /etc/$(PKGNAME)