mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2025-12-22 23:48:15 +03:00
v1.0. Luaposix, multiple service instances.
This commit is contained in:
@@ -1,52 +1,48 @@
|
||||
config main 'config'
|
||||
option mode '2'
|
||||
option mode '1'
|
||||
option enable_logger '1'
|
||||
|
||||
config ui 'ui'
|
||||
list hosts '8.8.8.8'
|
||||
list hosts '1.1.1.1'
|
||||
option check_type '0'
|
||||
option tcp_port '53'
|
||||
option ui_interval_up '6'
|
||||
option ui_interval_down '1'
|
||||
option ui_connection_attempts '1'
|
||||
option ui_connection_timeout '1'
|
||||
option service_interval_up '30'
|
||||
option service_interval_down '5'
|
||||
option service_connection_attempts '2'
|
||||
option service_connection_timeout '2'
|
||||
option service_enable_logger '1'
|
||||
option interval_up '6'
|
||||
option interval_down '1'
|
||||
option connection_attempts '1'
|
||||
option connection_timeout '1'
|
||||
|
||||
config module 'mod_led_control'
|
||||
option enabled '0'
|
||||
|
||||
config module 'mod_reboot'
|
||||
option enabled '0'
|
||||
option dead_period '3600'
|
||||
option force_reboot_delay '300'
|
||||
|
||||
config module 'mod_network_restart'
|
||||
option enabled '0'
|
||||
option dead_period '900'
|
||||
option attempts '1'
|
||||
option restart_timeout '0'
|
||||
|
||||
config module 'mod_modem_restart'
|
||||
option enabled '0'
|
||||
option dead_period '600'
|
||||
option any_band '0'
|
||||
|
||||
config module 'mod_public_ip'
|
||||
option enabled '0'
|
||||
option provider 'opendns1'
|
||||
option interval '600'
|
||||
option timeout '3'
|
||||
|
||||
config module 'mod_email'
|
||||
option enabled '0'
|
||||
option alive_period '0'
|
||||
option mail_smtp 'smtp.gmail.com'
|
||||
option mail_smtp_port '587'
|
||||
option mail_security 'tls'
|
||||
|
||||
config module 'mod_user_scripts'
|
||||
option enabled '0'
|
||||
option alive_period '0'
|
||||
option dead_period '0'
|
||||
config instance 'internet'
|
||||
option enabled '1'
|
||||
list hosts '8.8.8.8'
|
||||
list hosts '1.1.1.1'
|
||||
option check_type '0'
|
||||
option tcp_port '53'
|
||||
option interval_up '30'
|
||||
option interval_down '5'
|
||||
option connection_attempts '2'
|
||||
option connection_timeout '2'
|
||||
option mod_led_control_enabled '0'
|
||||
option mod_reboot_enabled '0'
|
||||
option mod_reboot_dead_period '3600'
|
||||
option mod_reboot_force_reboot_delay '300'
|
||||
option mod_network_restart_enabled '0'
|
||||
option mod_network_restart_dead_period '900'
|
||||
option mod_network_restart_attempts '1'
|
||||
option mod_network_restart_restart_timeout '0'
|
||||
option mod_modem_restart_enabled '0'
|
||||
option mod_modem_restart_dead_period '600'
|
||||
option mod_modem_restart_any_band '0'
|
||||
option mod_public_ip_enabled '0'
|
||||
option mod_public_ip_provider 'opendns1'
|
||||
option mod_public_ip_qtype '0'
|
||||
option mod_public_ip_interval '600'
|
||||
option mod_public_ip_timeout '3'
|
||||
option mod_email_enabled '0'
|
||||
option mod_email_alive_period '0'
|
||||
option mod_email_mail_smtp 'smtp.gmail.com'
|
||||
option mod_email_mail_smtp_port '587'
|
||||
option mod_email_mail_security 'tls'
|
||||
option mod_user_scripts_enabled '0'
|
||||
option mod_user_scripts_alive_period '0'
|
||||
option mod_user_scripts_dead_period '0'
|
||||
|
||||
@@ -3,17 +3,23 @@
|
||||
START=97
|
||||
STOP=01
|
||||
|
||||
ID="/usr/bin/internet-detector"
|
||||
PROG=/usr/bin/internet-detector
|
||||
|
||||
config_app() {
|
||||
config_get enabled "$1" enabled "0"
|
||||
if [ $enabled = "1" ]; then
|
||||
$PROG service "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
$ID
|
||||
config_load internet-detector
|
||||
config_get mode "config" mode "0"
|
||||
if [ $mode = "1" ]; then
|
||||
config_foreach config_app "instance"
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
$ID stop
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
$PROG stop
|
||||
}
|
||||
|
||||
0
internet-detector/files/etc/internet-detector/down-script → internet-detector/files/etc/internet-detector/down-script.internet
Executable file → Normal file
0
internet-detector/files/etc/internet-detector/down-script → internet-detector/files/etc/internet-detector/down-script.internet
Executable file → Normal file
0
internet-detector/files/etc/internet-detector/up-script → internet-detector/files/etc/internet-detector/up-script.internet
Executable file → Normal file
0
internet-detector/files/etc/internet-detector/up-script → internet-detector/files/etc/internet-detector/up-script.internet
Executable file → Normal file
Reference in New Issue
Block a user