v1.5. Some new options. New package structure.

This commit is contained in:
gSpot
2025-06-05 01:00:21 +03:00
parent d0c1f03ce5
commit 9803fe0ab4
22 changed files with 590 additions and 271 deletions

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector-mod-email
PKG_VERSION:=1.4.6
PKG_VERSION:=1.5.0
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>
@@ -34,8 +34,8 @@ define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/internet-detector
$(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/mod_email.lua $(1)/usr/lib/lua/internet-detector/mod_email.lua
$(INSTALL_DIR) $(1)/usr/lib/lua/internet-detector/modules
$(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/modules/mod_email.lua $(1)/usr/lib/lua/internet-detector/modules/mod_email.lua
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -70,6 +70,12 @@ function Module:init(t)
if t.mail_security ~= nil then
self.mailSecurity = t.mail_security
end
if tonumber(t.message_at_startup) == 1 then
self._msgSentDisconnect = false
self._disconnected = false
self._msgSentConnect = false
self._connected = false
end
if unistd.access(self.mta, "x") then
self._enabled = true
@@ -142,7 +148,7 @@ function Module:sendMessage(msg, textPattern)
end
end
function Module:run(currentStatus, lastStatus, timeDiff, timeNow, inetChecked)
function Module:run(currentStatus, lastStatus, timeDiff, timeNow)
if not self._enabled then
return
end