mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 08:53:56 +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
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=https://github.com/ysurac/glorytun.git
|
||||
PKG_SOURCE_VERSION:=203c5f2223d7d5146d659b51159b2f02c2480d15
|
||||
PKG_NAME:=glorytun-udp
|
||||
PKG_VERSION:=0.3.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=BSD-2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
|
||||
+10
-3
@@ -32,6 +32,8 @@ validate_section() {
|
||||
|
||||
start_instance() {
|
||||
local enable key host port listener proto mtuauto chacha dev mode
|
||||
local key_dir="/var/run/${PROG_NAME}"
|
||||
local key_file="${key_dir}/${1}.key"
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
@@ -46,7 +48,12 @@ start_instance() {
|
||||
[ -n "${dev}" ] || return 1
|
||||
[ -n "${mode}" ] || return 1
|
||||
|
||||
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
|
||||
mkdir -p "$key_dir"
|
||||
chmod 0700 "$key_dir"
|
||||
( umask 077; printf '%s\n' "$key" > "$key_file" ) || {
|
||||
_err "can't create key file"
|
||||
return 1
|
||||
}
|
||||
key=""
|
||||
|
||||
if [ "$(uci -q get network.omrvpn)" != "" ]; then
|
||||
@@ -68,14 +75,14 @@ start_instance() {
|
||||
procd_set_param command ${PROG} \
|
||||
${bind} \
|
||||
${dev:+dev "$dev"} \
|
||||
keyfile /tmp/${PROG_NAME}-${1}.key \
|
||||
keyfile "$key_file" \
|
||||
persist
|
||||
|
||||
[ "${chacha}" = "1" ] && procd_append_param command chacha
|
||||
|
||||
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