Add OpenWrt remote hub
This commit is contained in:
1 parent
48cba62f21
commit
38a92b0b1f
19 files changed
+2080
-2123
No files matched your search
@@ -1,6 +0,0 @@
|
||||
config backup 'main'
|
||||
option output_dir '/tmp'
|
||||
option include_overlay '1'
|
||||
option include_rom '0'
|
||||
option include_raw_mtd '0'
|
||||
option keep_days '0'
|
||||
@@ -0,0 +1,20 @@
|
||||
config remote 'main'
|
||||
option enabled '0'
|
||||
option router_id 'main'
|
||||
option router_name 'Главный роутер'
|
||||
option role 'main'
|
||||
option hub_url ''
|
||||
option hub_token ''
|
||||
option heartbeat_interval '30'
|
||||
option xray_bin '/usr/bin/xray'
|
||||
option xray_config '/etc/xray/owrt-remote-client.json'
|
||||
option vps_host ''
|
||||
option vps_port '8443'
|
||||
option vless_uuid ''
|
||||
option vless_encryption 'none'
|
||||
option vless_flow ''
|
||||
option reverse_tag 'reverse-in'
|
||||
option admin_host '127.0.0.1'
|
||||
option admin_port '80'
|
||||
option public_url ''
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
uci_get() {
|
||||
local key default value
|
||||
key="$1"
|
||||
default="$2"
|
||||
value="$(uci -q get "owrtremote.main.$key" 2>/dev/null || true)"
|
||||
[ -n "$value" ] && {
|
||||
printf '%s' "$value"
|
||||
return
|
||||
}
|
||||
printf '%s' "$default"
|
||||
}
|
||||
|
||||
enabled() {
|
||||
case "$(uci_get enabled 0)" in
|
||||
1|yes|true|on|enabled) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if ! enabled; then
|
||||
echo "owrt-remote disabled in /etc/config/owrtremote"
|
||||
return 0
|
||||
fi
|
||||
|
||||
procd_open_instance xray
|
||||
procd_set_param command /usr/sbin/owrt-remote run
|
||||
procd_set_param respawn 3600 5 5
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
|
||||
procd_open_instance heartbeat
|
||||
procd_set_param command /usr/sbin/owrt-remote heartbeat-loop
|
||||
procd_set_param respawn 3600 5 5
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger owrtremote
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user