diff --git a/README.md b/README.md index 7d4da8e..c32fd43 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,22 @@ Internet-detector is an application for checking the availability of the Interne ## Installation notes (OpenWrt >= 21.02) opkg update - wget --no-check-certificate -O /tmp/internet-detector_1.3.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.3.3-r1_all.ipk - opkg install /tmp/internet-detector_1.3.3-r1_all.ipk - rm /tmp/internet-detector_1.3.3-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector_1.4.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.4.0-r1_all.ipk + opkg install /tmp/internet-detector_1.4.0-r1_all.ipk + rm /tmp/internet-detector_1.4.0-r1_all.ipk /etc/init.d/internet-detector start /etc/init.d/internet-detector enable - wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.3.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.3.3-r1_all.ipk - opkg install /tmp/luci-app-internet-detector_1.3.3-r1_all.ipk - rm /tmp/luci-app-internet-detector_1.3.3-r1_all.ipk + wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.4.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.4.0-r1_all.ipk + opkg install /tmp/luci-app-internet-detector_1.4.0-r1_all.ipk + rm /tmp/luci-app-internet-detector_1.4.0-r1_all.ipk /etc/init.d/rpcd restart i18n-ru: - wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.3.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.3.3-r1_all.ipk - opkg install /tmp/luci-i18n-internet-detector-ru_1.3.3-r1_all.ipk - rm /tmp/luci-i18n-internet-detector-ru_1.3.3-r1_all.ipk + wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.4.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.4.0-r1_all.ipk + opkg install /tmp/luci-i18n-internet-detector-ru_1.4.0-r1_all.ipk + rm /tmp/luci-i18n-internet-detector-ru_1.4.0-r1_all.ipk ## Screenshots: @@ -42,9 +42,9 @@ i18n-ru: **Dependences:** modemmanager. - wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.3.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.3.3-r1_all.ipk - opkg install /tmp/internet-detector-mod-modem-restart_1.3.3-r1_all.ipk - rm /tmp/internet-detector-mod-modem-restart_1.3.3-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.4.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.4.0-r1_all.ipk + opkg install /tmp/internet-detector-mod-modem-restart_1.4.0-r1_all.ipk + rm /tmp/internet-detector-mod-modem-restart_1.4.0-r1_all.ipk /etc/init.d/internet-detector restart ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/04.jpg) @@ -53,9 +53,9 @@ i18n-ru: **Dependences:** mailsend. - wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.3.3-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.3.3-r1_all.ipk - opkg install /tmp/internet-detector-mod-email_1.3.3-r1_all.ipk - rm /tmp/internet-detector-mod-email_1.3.3-r1_all.ipk + wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.4.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.4.0-r1_all.ipk + opkg install /tmp/internet-detector-mod-email_1.4.0-r1_all.ipk + rm /tmp/internet-detector-mod-email_1.4.0-r1_all.ipk /etc/init.d/internet-detector restart ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/05.jpg) diff --git a/internet-detector-mod-email/Makefile b/internet-detector-mod-email/Makefile index 7ca482f..f34d82c 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.3.3 +PKG_VERSION:=1.4.0 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector-mod-email/files/usr/lib/lua/internet-detector/mod_email.lua b/internet-detector-mod-email/files/usr/lib/lua/internet-detector/mod_email.lua index 963435a..bda33e0 100644 --- a/internet-detector-mod-email/files/usr/lib/lua/internet-detector/mod_email.lua +++ b/internet-detector-mod-email/files/usr/lib/lua/internet-detector/mod_email.lua @@ -129,7 +129,7 @@ function Module:sendMessage(msg, textPattern) end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if not self._enabled then return end diff --git a/internet-detector-mod-modem-restart/Makefile b/internet-detector-mod-modem-restart/Makefile index 407fc6d..1f9981a 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.3.3 +PKG_VERSION:=1.4.0 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/internet-detector-mod-modem-restart/files/usr/lib/lua/internet-detector/mod_modem_restart.lua b/internet-detector-mod-modem-restart/files/usr/lib/lua/internet-detector/mod_modem_restart.lua index c9e15a9..ed1dbbe 100644 --- a/internet-detector-mod-modem-restart/files/usr/lib/lua/internet-detector/mod_modem_restart.lua +++ b/internet-detector-mod-modem-restart/files/usr/lib/lua/internet-detector/mod_modem_restart.lua @@ -80,7 +80,7 @@ function Module:init(t) end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if not self._enabled then return end diff --git a/internet-detector/Makefile b/internet-detector/Makefile index eb411f7..b08bc50 100644 --- a/internet-detector/Makefile +++ b/internet-detector/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector -PKG_VERSION:=1.3.3 +PKG_VERSION:=1.4.0 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot @@ -31,6 +31,7 @@ define Package/$(PKG_NAME)/conffiles /etc/internet-detector/down-script.internet /etc/internet-detector/up-script.internet /etc/internet-detector/public-ip-script.internet +/etc/internet-detector/regular-script.internet endef define Build/Configure @@ -46,6 +47,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_DATA) ./files/etc/internet-detector/down-script.internet $(1)/etc/internet-detector/down-script.internet $(INSTALL_DATA) ./files/etc/internet-detector/up-script.internet $(1)/etc/internet-detector/up-script.internet $(INSTALL_DATA) ./files/etc/internet-detector/public-ip-script.internet $(1)/etc/internet-detector/public-ip-script.internet + $(INSTALL_DATA) ./files/etc/internet-detector/regular-script.internet $(1)/etc/internet-detector/regular-script.internet $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/internet-detector $(1)/etc/init.d/internet-detector $(INSTALL_DIR) $(1)/usr/bin @@ -57,6 +59,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/mod_network_restart.lua $(1)/usr/lib/lua/internet-detector/mod_network_restart.lua $(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/mod_public_ip.lua $(1)/usr/lib/lua/internet-detector/mod_public_ip.lua $(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/mod_user_scripts.lua $(1)/usr/lib/lua/internet-detector/mod_user_scripts.lua + $(INSTALL_DATA) ./files/usr/lib/lua/internet-detector/mod_regular_script.lua $(1)/usr/lib/lua/internet-detector/mod_regular_script.lua endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/internet-detector/files/etc/config/internet-detector b/internet-detector/files/etc/config/internet-detector index 2bfcc31..18a81f7 100644 --- a/internet-detector/files/etc/config/internet-detector +++ b/internet-detector/files/etc/config/internet-detector @@ -36,3 +36,6 @@ config instance 'internet' option mod_user_scripts_enabled '0' option mod_user_scripts_alive_period '0' option mod_user_scripts_dead_period '0' + option mod_regular_script_enabled '0' + option mod_regular_script_inet_state '2' + option mod_regular_script_interval '3600' diff --git a/internet-detector/files/etc/internet-detector/regular-script.internet b/internet-detector/files/etc/internet-detector/regular-script.internet new file mode 100644 index 0000000..94df551 --- /dev/null +++ b/internet-detector/files/etc/internet-detector/regular-script.internet @@ -0,0 +1 @@ +# Shell commands that are run regularly 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 7f1cef6..fc0f33c 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/main.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/main.lua @@ -390,7 +390,7 @@ function InternetDetector:mainLoop() mTimeDiff = 1 end mLastTime = mTimeNow - e:run(currentStatus, lastStatus, mTimeDiff) + e:run(currentStatus, lastStatus, mTimeDiff, mTimeNow) end local modulesStatus = {} diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_led_control.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_led_control.lua index 95d3653..07a2523 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/mod_led_control.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_led_control.lua @@ -100,7 +100,7 @@ function Module:getCurrentState() end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if not self._enabled then return end diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_network_restart.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_network_restart.lua index 54167d3..57e4ed5 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/mod_network_restart.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_network_restart.lua @@ -76,7 +76,7 @@ function Module:init(t) end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if currentStatus == 1 then if self.attempts == 0 or self._attemptsCounter < self.attempts then if self._deadCounter >= self.deadPeriod then diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_public_ip.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_public_ip.lua index 14cb7fe..af8b77c 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/mod_public_ip.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_public_ip.lua @@ -359,7 +359,7 @@ function Module:init(t) self._enabled = true end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if not self._enabled then return end diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_reboot.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_reboot.lua index 6ec9c12..86fa28f 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/mod_reboot.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_reboot.lua @@ -34,7 +34,7 @@ function Module:init(t) end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if currentStatus == 1 then if self._deadCounter >= self.deadPeriod then self:rebootDevice() diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_regular_script.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_regular_script.lua new file mode 100644 index 0000000..af68fe2 --- /dev/null +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_regular_script.lua @@ -0,0 +1,55 @@ + +local stdlib = require("posix.stdlib") +local unistd = require("posix.unistd") + +local Module = { + name = "mod_regular_script", + runPrio = 90, + config = {}, + syslog = function(level, msg) return true end, + writeValue = function(filePath, str) return false end, + readValue = function(filePath) return nil end, + inetState = 2, -- 0: connected, 1: disconnected, 2: both + interval = 3600, + script = "", + status = nil, + _nextTime = nil, +} + +function Module:runExternalScript(scriptPath, currentStatus) + if unistd.access(scriptPath, "r") then + stdlib.setenv("INET_STATE", currentStatus) + os.execute(string.format('/bin/sh "%s" &', scriptPath)) + end +end + +function Module:init(t) + if t.inet_state ~= nil then + self.inetState = tonumber(t.inet_state) + end + if t.interval ~= nil then + self.interval = tonumber(t.interval) + end + if self.config.configDir then + self.script = string.format( + "%s/regular-script.%s", self.config.configDir, self.config.serviceConfig.instance) + end +end + +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) + if not self._nextTime then + if timeNow < self.interval then + self._nextTime = self.interval + else + self._nextTime = timeNow - (timeNow % self.interval) + self.interval + end + end + if timeNow >= self._nextTime then + if self.inetState == 2 or (self.inetState == 0 and currentStatus == 0) or (self.inetState == 1 and currentStatus == 1) then + self:runExternalScript(self.script, currentStatus) + end + self._nextTime = self._nextTime + self.interval + end +end + +return Module diff --git a/internet-detector/files/usr/lib/lua/internet-detector/mod_user_scripts.lua b/internet-detector/files/usr/lib/lua/internet-detector/mod_user_scripts.lua index 9da42a4..355f1ab 100644 --- a/internet-detector/files/usr/lib/lua/internet-detector/mod_user_scripts.lua +++ b/internet-detector/files/usr/lib/lua/internet-detector/mod_user_scripts.lua @@ -40,7 +40,7 @@ function Module:init(t) end end -function Module:run(currentStatus, lastStatus, timeDiff) +function Module:run(currentStatus, lastStatus, timeDiff, timeNow) if currentStatus == 1 then self._aliveCounter = 0 self._downScriptExecuted = false diff --git a/luci-app-internet-detector/Makefile b/luci-app-internet-detector/Makefile index 46a0574..3b558f4 100644 --- a/luci-app-internet-detector/Makefile +++ b/luci-app-internet-detector/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-internet-detector -PKG_VERSION:=1.3.3 +PKG_VERSION:=1.4.0 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for internet-detector LUCI_DEPENDS:=+internet-detector diff --git a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js index 94caf5e..5dcce66 100644 --- a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js +++ b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js @@ -68,7 +68,10 @@ var Timefield = ui.Textfield.extend({ let string = '0'; if(/^\d+$/.test(value)) { value = Number(value); - if(value >= 3600 && (value % 3600) === 0) { + if(value >= 86400 && (value % 86400) === 0) { + string = String(value / 86400) + 'd'; + } + else if(value >= 3600 && (value % 3600) === 0) { string = String(value / 3600) + 'h'; } else if(value >= 60 && (value % 60) === 0) { @@ -101,9 +104,12 @@ var Timefield = ui.Textfield.extend({ getValue() { let rawValue = this.node.querySelector('input').value, value = 0, - res = rawValue.match(/^(\d+)([hms]?)$/); + res = rawValue.match(/^(\d+)([dhms]?)$/); if(res) { - if(res[2] === 'h') { + if(res[2] === 'd') { + value = Number(res[1]) * 86400; + } + else if(res[2] === 'h') { value = Number(res[1]) * 3600; } else if(res[2] === 'm') { @@ -321,8 +327,8 @@ return view.extend({ placeholder: _('Type a time string'), validate : L.bind( function(section, value) { - return (/^$|^\d+[hms]?$/.test(value)) ? true : _('Expecting:') + - ` ${_('One of the following:')}\n - ${_('hours')}: 2h\n - ${_('minutes')}: 10m\n - ${_('seconds')}: 30s\n`; + return (/^$|^\d+[dhms]?$/.test(value)) ? true : _('Expecting:') + + ` ${_('One of the following:')}\n - ${_('days')}: 1d\n - ${_('hours')}: 2h\n - ${_('minutes')}: 10m\n - ${_('seconds')}: 30s\n`; }, this, section_id @@ -560,6 +566,7 @@ return view.extend({ /* Main settings */ // mode + let mode = s.option(form.ListValue, 'mode', _('Internet detector mode')); mode.value('0', _('Disabled')); @@ -572,7 +579,6 @@ return view.extend({ ); mode.default = '0'; - /* Service instances configuration */ if(this.currentAppMode !== '2') { @@ -736,6 +742,7 @@ return view.extend({ s.tab('email', _('Email notification')); }; s.tab('user_scripts', _('User scripts')); + s.tab('regular_script', _('Regular script')); }; s.addModalOptions = (s, section_id, ev) => { @@ -1160,7 +1167,7 @@ return view.extend({ o.rmempty = false; o.modalonly = true; - // up_script edit dialog + // up_script edit o = s.taboption('user_scripts', this.CBIBlockFileEdit, this, 'up_script', this.configDir + '/up-script.' + s.section, @@ -1178,7 +1185,7 @@ return view.extend({ o.rmempty = false; o.modalonly = true; - // down_script edit dialog + // down_script edit o = s.taboption('user_scripts', this.CBIBlockFileEdit, this, 'down_script', this.configDir + '/down-script.' + s.section, @@ -1195,6 +1202,48 @@ return view.extend({ o.default = '0'; o.rmempty = false; o.modalonly = true; + + // Regular script + + o = s.taboption('regular_script', form.DummyValue, '_dummy'); + o.rawhtml = true; + o.default = '
' + + _('Shell commands that are run regularly.') + + '
'; + o.modalonly = true; + + // enabled + o = s.taboption('regular_script', form.Flag, 'mod_regular_script_enabled', + _('Enabled')); + o.rmempty = false; + o.modalonly = true; + + // inet_state + o = s.taboption('regular_script', form.ListValue, + 'mod_regular_script_inet_state', _('Run if Internet state is') + ); + o.modalonly = true; + o.value(0, _('connected')); + o.value(1, _('disconnected')); + o.value(2, _('connected or disconnected')); + o.default = '2'; + + // regular_script edit + o = s.taboption('regular_script', this.CBIBlockFileEdit, this, + 'regular_script', + this.configDir + '/regular-script.' + s.section, + _('Edit regular-script'), + _('Shell commands that run regularly at a specified interval. Current state of the Internet is available as value of the $INET_STATE variable (0 - connected, 1 - disconnected).') + ); + o.modalonly = true; + + // interval + o = s.taboption('regular_script', this.CBITimeInput, + 'mod_regular_script_interval', _('Run interval') + ); + o.default = '3600'; + o.rmempty = false; + o.modalonly = true; }; }; diff --git a/luci-app-internet-detector/po/ru/internet-detector.po b/luci-app-internet-detector/po/ru/internet-detector.po index 358c654..bf8b8c7 100644 --- a/luci-app-internet-detector/po/ru/internet-detector.po +++ b/luci-app-internet-detector/po/ru/internet-detector.po @@ -113,6 +113,9 @@ msgstr "Изменить" msgid "Edit down-script" msgstr "Изменить down-script" +msgid "Edit regular-script" +msgstr "Изменить regular-script" + msgid "Edit public-ip-script" msgstr "Изменить public-ip-script" @@ -314,6 +317,9 @@ msgid "" msgstr "" "Период времени отсутствия доступа в Интренет перед перезагрузкой устройства." +msgid "Regular script" +msgstr "Регулярный скрипт" + msgid "Polling interval" msgstr "Интервал опроса" @@ -341,6 +347,12 @@ msgstr "Перезапуск службы" msgid "Restart timeout" msgstr "Таймаут перезапуска" +msgid "Run interval" +msgstr "Интервал запуска" + +msgid "Run if Internet state is" +msgstr "Выполнять если статус Интернет" + msgid "Run service at startup" msgstr "Запуск службы при старте" @@ -389,9 +401,15 @@ msgstr "Экземпляры службы" msgid "Set the modem to be allowed to use any band." msgstr "Разрешить модему использование любой частоты." +msgid "Shell commands that are run regularly." +msgstr "Команды shell выполняемые регулярно." + msgid "Shell commands that run when connected to the Internet." msgstr "Команды shell выполняемые при подключении к Интернет." +msgid "Shell commands that run regularly at a specified interval. Current state of the Internet is available as value of the $INET_STATE variable (0 - connected, 1 - disconnected)." +msgstr "Команды shell выполняемые регулярно с заданным интервалом. Текущее состояние Интернет доступно как значение переменной $INET_STATE (0 - подключен, 1 - отключен)." + msgid "Shell commands that run when the public IP address changes. New IP is available as value of the $PUBLIC_IP variable (empty string if undefined)." msgstr "Команды shell выполняемые при изменении публичного IP адреса. Новый IP доступен как значение переменной $PUBLIC_IP (пустая строка если не определён)." @@ -474,11 +492,23 @@ msgstr "Записывать сообщения в системный журна msgid "after connection" msgstr "после подключения" +msgid "after connection or disconnection" +msgstr "после подключения или отключения" + msgid "after disconnection" msgstr "после отключения" -msgid "after connection or disconnection" -msgstr "после подключения или отключения" +msgid "connected" +msgstr "подключен" + +msgid "connected or disconnected" +msgstr "подключен или отключен" + +msgid "days" +msgstr "дни" + +msgid "disconnected" +msgstr "отключен" msgid "down-script" msgstr "down-script" diff --git a/luci-app-internet-detector/po/templates/internet-detector.pot b/luci-app-internet-detector/po/templates/internet-detector.pot index dc1d333..b654798 100644 --- a/luci-app-internet-detector/po/templates/internet-detector.pot +++ b/luci-app-internet-detector/po/templates/internet-detector.pot @@ -101,6 +101,9 @@ msgstr "" msgid "Edit down-script" msgstr "" +msgid "Edit regular-script" +msgstr "" + msgid "Edit public-ip-script" msgstr "" @@ -289,6 +292,9 @@ msgid "" "Period of time without Internet access until the device is rebooted." msgstr "" +msgid "Regular script" +msgstr "" + msgid "Polling interval" msgstr "" @@ -316,6 +322,12 @@ msgstr "" msgid "Restart timeout" msgstr "" +msgid "Run interval" +msgstr "" + +msgid "Run if Internet state is" +msgstr "" + msgid "Run service at startup" msgstr "" @@ -364,9 +376,15 @@ msgstr "" msgid "Set the modem to be allowed to use any band." msgstr "" +msgid "Shell commands that are run regularly." +msgstr "" + msgid "Shell commands that run when connected to the Internet." msgstr "" +msgid "Shell commands that run regularly at a specified interval. Current state of the Internet is available as value of the $INET_STATE variable (0 - connected, 1 - disconnected)." +msgstr "" + msgid "Shell commands that run when the public IP address changes. New IP is available as value of the $PUBLIC_IP variable (empty string if undefined)." msgstr "" @@ -448,7 +466,16 @@ msgstr "" msgid "after disconnection" msgstr "" -msgid "both" +msgid "connected" +msgstr "" + +msgid "connected or disconnected" +msgstr "" + +msgid "days" +msgstr "" + +msgid "disconnected" msgstr "" msgid "down-script" diff --git a/luci-app-internet-detector/root/usr/share/rpcd/acl.d/luci-app-internet-detector.json b/luci-app-internet-detector/root/usr/share/rpcd/acl.d/luci-app-internet-detector.json index 893ac23..0f9e8de 100644 --- a/luci-app-internet-detector/root/usr/share/rpcd/acl.d/luci-app-internet-detector.json +++ b/luci-app-internet-detector/root/usr/share/rpcd/acl.d/luci-app-internet-detector.json @@ -6,7 +6,8 @@ "/sys/class/leds": [ "list" ], "/etc/internet-detector/up-script*": [ "read" ], "/etc/internet-detector/down-script*": [ "read" ], - "/etc/internet-detector/public-ip-script*": [ "read" ] + "/etc/internet-detector/public-ip-script*": [ "read" ], + "/etc/internet-detector/regular-script*": [ "read" ] }, "uci": [ "internet-detector" ], "ubus": { @@ -18,7 +19,8 @@ "file": { "/etc/internet-detector/up-script*": [ "write" ], "/etc/internet-detector/down-script*": [ "write" ], - "/etc/internet-detector/public-ip-script*": [ "write" ] + "/etc/internet-detector/public-ip-script*": [ "write" ], + "/etc/internet-detector/regular-script*": [ "write" ] }, "uci": [ "internet-detector" ] }