diff --git a/README.md b/README.md index 79921c1..0388791 100644 --- a/README.md +++ b/README.md @@ -20,22 +20,22 @@ Internet-detector is an application for checking the availability of the Interne ## Installation notes: opkg update - wget --no-check-certificate -O /tmp/internet-detector_1.6.2-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.6.2-r1_all.ipk - opkg install /tmp/internet-detector_1.6.2-r1_all.ipk - rm /tmp/internet-detector_1.6.2-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.6.3-r1_all.ipk + opkg install /tmp/internet-detector_1.6.3-r1_all.ipk + rm /tmp/internet-detector_1.6.3-r1_all.ipk service internet-detector start service internet-detector enable - wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.6.2-r2_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.6.2-r2_all.ipk - opkg install /tmp/luci-app-internet-detector_1.6.2-r2_all.ipk - rm /tmp/luci-app-internet-detector_1.6.2-r2_all.ipk + wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.6.3-r1_all.ipk + opkg install /tmp/luci-app-internet-detector_1.6.3-r1_all.ipk + rm /tmp/luci-app-internet-detector_1.6.3-r1_all.ipk service rpcd restart i18n-ru: - wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.6.2-r2_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.6.2-r2_all.ipk - opkg install /tmp/luci-i18n-internet-detector-ru_1.6.2-r2_all.ipk - rm /tmp/luci-i18n-internet-detector-ru_1.6.2-r2_all.ipk + wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.6.3-r1_all.ipk + opkg install /tmp/luci-i18n-internet-detector-ru_1.6.3-r1_all.ipk + rm /tmp/luci-i18n-internet-detector-ru_1.6.3-r1_all.ipk ## Screenshots: @@ -47,9 +47,9 @@ i18n-ru: **Dependences:** modemmanager. - wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.6.2-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.6.2-r1_all.ipk - opkg install /tmp/internet-detector-mod-modem-restart_1.6.2-r1_all.ipk - rm /tmp/internet-detector-mod-modem-restart_1.6.2-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.6.3-r1_all.ipk + opkg install /tmp/internet-detector-mod-modem-restart_1.6.3-r1_all.ipk + rm /tmp/internet-detector-mod-modem-restart_1.6.3-r1_all.ipk service internet-detector restart ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/04.jpg) @@ -58,9 +58,9 @@ i18n-ru: **Dependences:** mailsend. - wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.6.2-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.6.2-r1_all.ipk - opkg install /tmp/internet-detector-mod-email_1.6.2-r1_all.ipk - rm /tmp/internet-detector-mod-email_1.6.2-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.6.3-r1_all.ipk + opkg install /tmp/internet-detector-mod-email_1.6.3-r1_all.ipk + rm /tmp/internet-detector-mod-email_1.6.3-r1_all.ipk service internet-detector restart ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/05.jpg) @@ -69,9 +69,9 @@ i18n-ru: **Dependences:** curl. - wget --no-check-certificate -O /tmp/internet-detector-mod-telegram_1.6.2-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-telegram_1.6.2-r1_all.ipk - opkg install /tmp/internet-detector-mod-telegram_1.6.2-r1_all.ipk - rm /tmp/internet-detector-mod-telegram_1.6.2-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector-mod-telegram_1.6.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-telegram_1.6.3-r1_all.ipk + opkg install /tmp/internet-detector-mod-telegram_1.6.3-r1_all.ipk + rm /tmp/internet-detector-mod-telegram_1.6.3-r1_all.ipk service internet-detector restart ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/06.jpg) diff --git a/internet-detector-mod-email/Makefile b/internet-detector-mod-email/Makefile index b629bd4..fb7ee39 100644 --- a/internet-detector-mod-email/Makefile +++ b/internet-detector-mod-email/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-email -PKG_VERSION:=1.6.2 +PKG_VERSION:=1.6.3 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector-mod-modem-restart/Makefile b/internet-detector-mod-modem-restart/Makefile index 4f530ca..86ef149 100644 --- a/internet-detector-mod-modem-restart/Makefile +++ b/internet-detector-mod-modem-restart/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-modem-restart -PKG_VERSION:=1.6.2 +PKG_VERSION:=1.6.3 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector-mod-telegram/Makefile b/internet-detector-mod-telegram/Makefile index 1a243d9..2138338 100644 --- a/internet-detector-mod-telegram/Makefile +++ b/internet-detector-mod-telegram/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-telegram -PKG_VERSION:=1.6.2 +PKG_VERSION:=1.6.3 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector/Makefile b/internet-detector/Makefile index ffef761..c05be25 100644 --- a/internet-detector/Makefile +++ b/internet-detector/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector -PKG_VERSION:=1.6.2 +PKG_VERSION:=1.6.3 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector/files/usr/lib/lua/internet-detector/main.lua b/internet-detector/files/usr/lib/lua/internet-detector/main.lua index d71f90c..6ad2028 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/main.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/main.lua @@ -16,7 +16,6 @@ local InternetDetector = { loggingLevel = 6, hostname = "OpenWrt", appName = "internet-detector", - commonDir = "/tmp/run", libDir = "/usr/lib/lua", pingCmd = "/bin/ping", pingParams = "-c 1", @@ -56,6 +55,7 @@ local InternetDetector = { InternetDetector.configDir = string.format("/etc/%s", InternetDetector.appName) InternetDetector.modulesDir = string.format( "%s/%s/modules", InternetDetector.libDir, InternetDetector.appName) +InternetDetector.commonDir = string.format("/tmp/run/%s", InternetDetector.appName) -- Loading settings from UCI @@ -386,7 +386,6 @@ function InternetDetector:mainLoop() self:writeLogMessage("notice", "Disconnected") end end - counter = 0 end @@ -400,7 +399,6 @@ function InternetDetector:mainLoop() mTimeDiff = 1 end mLastTime = mTimeNow - if self.debug then e:run(currentStatus, lastStatus, mTimeDiff, mTimeNow, inetChecked) else @@ -553,6 +551,14 @@ function InternetDetector:preRun() io.stderr:write(string.format('Start failed, mode != (1 or 2)\n', self.appName)) os.exit(0) end + local s = stat.stat(self.commonDir) + if not s or not (stat.S_ISDIR(s.st_mode) ~= 0) then + if not stat.mkdir(self.commonDir) then + io.stderr:write( + string.format('Error occurred while creating %s. Exit.\n', self.commonDir)) + os.exit(1) + end + end if stat.stat(self.pidFile) then io.stderr:write( string.format('PID file "%s" exists. Is the %s already running?\n', diff --git a/luci-app-internet-detector/Makefile b/luci-app-internet-detector/Makefile index b0de27b..cb07f28 100644 --- a/luci-app-internet-detector/Makefile +++ b/luci-app-internet-detector/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-internet-detector -PKG_VERSION:=1.6.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.6.3 +PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for internet-detector LUCI_DEPENDS:=+internet-detector LUCI_PKGARCH:=all