mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 03:35:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,6 @@
|
||||
|
||||
config gost 'config'
|
||||
option enabled '0'
|
||||
option config_file ''
|
||||
#list arguments ''
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=99
|
||||
|
||||
CONF="gost"
|
||||
PROG="/usr/bin/gost"
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
config_load "gost"
|
||||
config_get_bool enabled "config" "enabled" 0
|
||||
[ "$enabled" -eq 1 ] || return 1
|
||||
|
||||
local config_file arguments
|
||||
config_get config_file "config" "config_file"
|
||||
config_get arguments "config" "arguments"
|
||||
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command "$PROG"
|
||||
if [ -n "$config_file" ]; then
|
||||
procd_append_param command -C "$config_file"
|
||||
procd_set_param file "$config_file"
|
||||
fi
|
||||
if [ -n "$arguments" ]; then
|
||||
set -- $arguments
|
||||
procd_append_param command "$@"
|
||||
fi
|
||||
|
||||
procd_set_param user gost
|
||||
procd_set_param group gost
|
||||
|
||||
procd_set_param limits core="unlimited"
|
||||
procd_set_param limits nofile="1000000 1000000"
|
||||
procd_set_param stderr 1
|
||||
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$CONF"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
grep -q "config gost$" "/etc/config/gost" || exit 0
|
||||
|
||||
sed -e "s,config gost,config gost 'config'," \
|
||||
-e "s,option enable ,option enabled ," \
|
||||
-e "s,option run_command,list arguments," \
|
||||
-i "/etc/config/gost"
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user