mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2025-12-06 11:36:49 +03:00
Minor fixes
This commit is contained in:
@@ -67,7 +67,8 @@ end
|
||||
-- Loading settings from UCI
|
||||
|
||||
local uciCursor = uci.cursor()
|
||||
Config.mode = uciCursor:get(Config.appName, "config", "mode")
|
||||
Config.mode = tonumber(uciCursor:get(
|
||||
Config.appName, "config", "mode"))
|
||||
Config.hosts = uciCursor:get(Config.appName, "config", "hosts")
|
||||
Config.checkType = tonumber(uciCursor:get(
|
||||
Config.appName, "config", "check_type"))
|
||||
@@ -263,7 +264,7 @@ local function status()
|
||||
end
|
||||
|
||||
local function poll(attempts, timeout)
|
||||
if Config.mode == "1" then
|
||||
if Config.mode == 1 then
|
||||
Config.connectionAttempts = Config.UIConnectionAttempts
|
||||
Config.connectionTimeout = Config.UIConnectionTimeout
|
||||
end
|
||||
@@ -287,7 +288,7 @@ local function inetStatus()
|
||||
if inetStatVal ~= nil and tonumber(inetStatVal) == 0 then
|
||||
inetStat = "up"
|
||||
end
|
||||
elseif Config.mode == "1" then
|
||||
elseif Config.mode == 1 then
|
||||
inetStat = poll()
|
||||
else
|
||||
os.exit(126)
|
||||
@@ -324,9 +325,9 @@ local function stop()
|
||||
end
|
||||
|
||||
local function preRun()
|
||||
-- Exit if internet-detector mode != 2(Service)
|
||||
if Config.mode ~= "2" then
|
||||
io.stderr:write(string.format('Start failed, mode != "2"\n', Config.appName))
|
||||
-- Exit if internet detector mode != 2(Service)
|
||||
if Config.mode ~= 2 then
|
||||
io.stderr:write(string.format('Start failed, mode != 2\n', Config.appName))
|
||||
os.exit(0)
|
||||
end
|
||||
if nixio.fs.access(Config.pidFile, "r") then
|
||||
|
||||
Reference in New Issue
Block a user