add Makefile for init script and Munin plugin
[usb-wde1-tools.git] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..4cba154
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+PLUGINS = /etc/munin/plugins
+
+install: lninstall
+
+lninstall:
+       ln -sf $(abspath init.d/usb-wde-log) /etc/init.d
+       insserv usb-wde-log
+
+       ln -sf $(abspath munin/usb-wde1_) $(PLUGINS)/usb-wde1_temperature
+       ln -sf $(abspath munin/usb-wde1_) $(PLUGINS)/usb-wde1_humidity
+
+uninstall:
+       service usb-wde-log stop
+       insserv -r usb-wde-log
+       rm -f /etc/init.d/usb-wde-log
+
+       rm -f $(PLUGINS)/usb-wde1_temperature
+       rm -f $(PLUGINS)/usb-wde1_humidity
+
+.PHONY: install lninstall uninstall