mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 19:05:13 +08:00
🌈 Sync 2026-07-25 08:33:42
This commit is contained in:
1 parent
92bf601d26
commit
9c077adbc3
12 files changed
+396
-39
No files matched your search
+1
-1
@@ -9,7 +9,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=glorytun
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=95fa5ead2154adb546bcdb454c56c876e9f60bb5
|
||||
PKG_SOURCE:=glorytun-$(PKG_VERSION).tar.gz
|
||||
|
||||
+8
-4
@@ -82,6 +82,8 @@ optimize_cpu_cores() {
|
||||
|
||||
start_instance() {
|
||||
local enable key host port dev mptcp proto chacha20 mode multiqueue cpu_affinity timeout localip remoteip
|
||||
local key_dir="/var/run/${PROG_NAME}"
|
||||
local key_file="${key_dir}/${1}.key"
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
@@ -102,8 +104,10 @@ start_instance() {
|
||||
[ -n "${dev}" ] || return 1
|
||||
[ -n "${host}" ] || return 1
|
||||
|
||||
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
|
||||
[ -f "/tmp/${PROG_NAME}-${1}.key" ] || {
|
||||
mkdir -p "$key_dir"
|
||||
chmod 0700 "$key_dir"
|
||||
( umask 077; printf '%s\n' "$key" > "$key_file" )
|
||||
[ -f "$key_file" ] || {
|
||||
_err "can't create key file"
|
||||
return 1
|
||||
}
|
||||
@@ -119,7 +123,7 @@ start_instance() {
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command ${PROG} \
|
||||
keyfile /tmp/${PROG_NAME}-${1}.key \
|
||||
keyfile "$key_file" \
|
||||
${port:+port "$port"} \
|
||||
${host:+host "$host"} \
|
||||
${dev:+dev "$dev"}
|
||||
@@ -137,7 +141,7 @@ start_instance() {
|
||||
|
||||
procd_set_param respawn 0 30 0
|
||||
procd_set_param nice 10
|
||||
procd_set_param file /tmp/${PROG_NAME}-${1}.key
|
||||
procd_set_param file "$key_file"
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
Reference in new issue
Block a user