Changed common dir.

This commit is contained in:
gSpot
2025-08-25 23:49:39 +03:00
parent 73e98a682d
commit e9814cf85b
7 changed files with 33 additions and 27 deletions

View File

@@ -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)

View File

@@ -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 <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -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 <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -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 <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -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 <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -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',

View File

@@ -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