mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 15:35:13 +08:00
🐶 Sync 2026-06-03 21:58:23
This commit is contained in:
1 parent
4a70c88048
commit
c9c56d7f6e
33 files changed
+485
-162
No files matched your search
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
NAME=opera-proxy
|
||||
PROG=/usr/bin/${NAME}
|
||||
|
||||
start_service() {
|
||||
local country bind_address verbosity socks_mode timeout
|
||||
|
||||
config_load opera-proxy
|
||||
config_get country main country "EU"
|
||||
config_get bind_address main bind_address "127.0.0.1:18080"
|
||||
config_get verbosity main verbosity "20"
|
||||
config_get timeout main timeout "10s"
|
||||
config_get_bool socks_mode main socks_mode 0
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -country "$country"
|
||||
procd_append_param command -bind-address "$bind_address"
|
||||
procd_append_param command -verbosity "$verbosity"
|
||||
procd_append_param command -timeout "$timeout"
|
||||
|
||||
[ "$socks_mode" = "1" ] && procd_append_param command -socks-mode
|
||||
|
||||
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "opera-proxy"
|
||||
}
|
||||
Reference in new issue
Block a user