mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 14:33:56 +08:00
update 2026-05-27 23:25:57
This commit is contained in:
1 parent
84f707b52b
commit
d0159b49a5
759 files changed
+362365
No files matched your search
@@ -0,0 +1,65 @@
|
||||
|
||||
config main 'config'
|
||||
option mode '1'
|
||||
option logging_level '6'
|
||||
|
||||
config instance 'internet'
|
||||
option enabled '1'
|
||||
option description 'Default instance'
|
||||
list hosts '8.8.8.8'
|
||||
list hosts '1.1.1.1'
|
||||
list urls 'https://www.google.com'
|
||||
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_disconnected_at_startup '0'
|
||||
option mod_reboot_dead_period '3600'
|
||||
option mod_reboot_force_reboot_delay '300'
|
||||
option mod_network_restart_enabled '0'
|
||||
option mod_network_restart_disconnected_at_startup '0'
|
||||
option mod_network_restart_dead_period '900'
|
||||
option mod_network_restart_attempts '1'
|
||||
option mod_network_restart_attempt_interval '60'
|
||||
option mod_network_restart_device_timeout '0'
|
||||
option mod_modem_restart_enabled '0'
|
||||
option mod_modem_restart_disconnected_at_startup '0'
|
||||
option mod_modem_restart_dead_period '600'
|
||||
option mod_modem_restart_attempts '1'
|
||||
option mod_modem_restart_attempt_interval '60'
|
||||
option mod_modem_restart_iface_timeout '0'
|
||||
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_interval_failed '60'
|
||||
option mod_public_ip_request_attempts '2'
|
||||
option mod_public_ip_timeout '2'
|
||||
option mod_public_ip_enable_ip_script '0'
|
||||
option mod_email_enabled '0'
|
||||
option mod_email_message_at_startup '0'
|
||||
option mod_email_mode '0'
|
||||
option mod_email_alive_period '0'
|
||||
option mod_email_mail_security 'tls'
|
||||
option mod_telegram_enabled '0'
|
||||
option mod_telegram_message_at_startup '0'
|
||||
option mod_telegram_mode '0'
|
||||
option mod_telegram_dead_period '0'
|
||||
option mod_telegram_alive_period '0'
|
||||
option mod_user_scripts_enabled '0'
|
||||
option mod_user_scripts_alive_period '0'
|
||||
option mod_user_scripts_up_script_attempts '1'
|
||||
option mod_user_scripts_up_script_attempt_interval '60'
|
||||
option mod_user_scripts_connected_at_startup '0'
|
||||
option mod_user_scripts_dead_period '0'
|
||||
option mod_user_scripts_down_script_attempts '1'
|
||||
option mod_user_scripts_down_script_attempt_interval '60'
|
||||
option mod_user_scripts_disconnected_at_startup '0'
|
||||
option mod_regular_script_enabled '0'
|
||||
option mod_regular_script_inet_state '2'
|
||||
option mod_regular_script_interval '3600'
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/bin/internet-detector"
|
||||
|
||||
run_instance() {
|
||||
config_get enabled "$1" enabled "0"
|
||||
if [ $enabled = "1" ]; then
|
||||
procd_open_instance "$1"
|
||||
procd_set_param command "$PROG" "-a" "nodaemon" "-i" "$1"
|
||||
procd_set_param respawn
|
||||
procd_set_param term_timeout 60
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "internet-detector"
|
||||
config_get mode "config" mode "0"
|
||||
if [ $mode = "1" ]; then
|
||||
config_foreach run_instance "instance"
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
$PROG -a stop
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "internet-detector"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
# Shell commands to run when disconnected from the Internet
|
||||
@@ -0,0 +1,2 @@
|
||||
# Shell commands that run when the public IP address changes.
|
||||
# New IP is available as value of the $PUBLIC_IP variable.
|
||||
@@ -0,0 +1 @@
|
||||
# Shell commands that are run regularly
|
||||
@@ -0,0 +1 @@
|
||||
# Shell commands that run when connected to the Internet
|
||||
Reference in new issue
Block a user