mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2026-01-31 15:00:32 +03:00
v0.3. Internet detector daemon
This commit is contained in:
18
internet-detector/files/etc/config/internet-detector
Normal file
18
internet-detector/files/etc/config/internet-detector
Normal file
@@ -0,0 +1,18 @@
|
||||
config main 'config'
|
||||
option mode '2'
|
||||
option enable_logger '1'
|
||||
option enable_up_script '0'
|
||||
option enable_down_script '0'
|
||||
option enable_run_script '0'
|
||||
option interval_up '30'
|
||||
option interval_down '5'
|
||||
option ui_interval_up '6'
|
||||
option ui_interval_down '1'
|
||||
list hosts '8.8.8.8'
|
||||
list hosts '1.1.1.1'
|
||||
option check_type '0'
|
||||
option connection_attempts '2'
|
||||
option connection_timeout '2'
|
||||
option ui_connection_attempts '1'
|
||||
option ui_connection_timeout '1'
|
||||
option tcp_port '53'
|
||||
19
internet-detector/files/etc/init.d/internet-detector
Executable file
19
internet-detector/files/etc/init.d/internet-detector
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
ID="/usr/bin/internet-detector"
|
||||
|
||||
start() {
|
||||
$ID
|
||||
}
|
||||
|
||||
stop() {
|
||||
$ID stop
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
1
internet-detector/files/etc/internet-detector/down-script
Executable file
1
internet-detector/files/etc/internet-detector/down-script
Executable file
@@ -0,0 +1 @@
|
||||
# Shell commands to run when disconnected from the Internet
|
||||
4
internet-detector/files/etc/internet-detector/run-script
Executable file
4
internet-detector/files/etc/internet-detector/run-script
Executable file
@@ -0,0 +1,4 @@
|
||||
# Shell commands that are executed every time the Internet is checked for availability
|
||||
#
|
||||
# $1 - (0|1) - internet status: 0 is up, 1 is down
|
||||
#
|
||||
1
internet-detector/files/etc/internet-detector/up-script
Executable file
1
internet-detector/files/etc/internet-detector/up-script
Executable file
@@ -0,0 +1 @@
|
||||
# Shell commands that run when connected to the Internet
|
||||
Reference in New Issue
Block a user