From c94e334c4e5251d09995e3f6c8b80d61928a451c Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Wed, 11 Jan 2017 18:54:40 -0500 Subject: [PATCH] net-nut: Add UPS notifications via sendmail Add option to send email notification via sendmail (or replacement). Signed-off-by: Daniel Dickinson --- net/nut/Makefile | 19 ++++++++++ net/nut/files/nut-sendmail-notify | 10 ++++++ net/nut/files/nut-sendmail-notify.default | 44 +++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100755 net/nut/files/nut-sendmail-notify create mode 100644 net/nut/files/nut-sendmail-notify.default diff --git a/net/nut/Makefile b/net/nut/Makefile index 25d93c48d..c2c38da98 100644 --- a/net/nut/Makefile +++ b/net/nut/Makefile @@ -152,6 +152,24 @@ define Package/nut-upsmon/install ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf endef +define Package/nut-upsmon-sendmail-notify + $(call Package/nut/Default) + TITLE+= (upsmon with notifications via sendmail) + DEPENDS:=nut +nut-upsmon + CONFLICTS:=nut-upssched +endef + +define Package/nut-upsmon-sendmail-notify/description +$(call Package/nut/description/Default) +upsmon with default notification via sendmail +endef + +define Package/nut-upsmon-sendmail-notify/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/nut-sendmail-notify $(1)/usr/bin/ + $(INSTALL_DATA) ./files/nut-sendmail-notify.default $(1)/etc/uci-defaults/nut-sendmail-notify +endef + define Package/nut-upsc $(call Package/nut/Default) TITLE+= (upsc command) @@ -504,6 +522,7 @@ $(eval $(call BuildPackage,nut)) $(eval $(call BuildPackage,nut-common)) $(eval $(call BuildPackage,nut-server)) $(eval $(call BuildPackage,nut-upsmon)) +$(eval $(call BuildPackage,nut-upsmon-sendmail-notify)) $(eval $(call BuildPackage,nut-upsc)) $(eval $(call BuildPackage,nut-upscmd)) $(eval $(call BuildPackage,nut-upslog)) diff --git a/net/nut/files/nut-sendmail-notify b/net/nut/files/nut-sendmail-notify new file mode 100755 index 000000000..749aa9bf6 --- /dev/null +++ b/net/nut/files/nut-sendmail-notify @@ -0,0 +1,10 @@ +#!/bin/sh + +/usr/sbin/sendmail root <