Stabilize WAN reconnect tunnel recovery
This commit is contained in:
1 parent
fdd12f3880
commit
c98322364d
2 files changed
+38
-7
No files matched your search
@@ -404,7 +404,7 @@ service_enabled() {
|
||||
}
|
||||
|
||||
render_client_config() {
|
||||
local out stdout router_id vps_host vps_port uuid ssh_uuid encryption flow reverse_tag ssh_reverse_tag admin_host admin_port ssh_host ssh_port xray_config
|
||||
local out stdout router_id vps_host vps_port uuid ssh_uuid encryption flow reverse_tag ssh_reverse_tag admin_host admin_port ssh_host ssh_port xray_config xray_config_dir
|
||||
stdout="0"
|
||||
if [ "${1:-}" = "--stdout" ]; then
|
||||
stdout="1"
|
||||
@@ -429,7 +429,13 @@ render_client_config() {
|
||||
[ -n "$uuid" ] || die "vless_uuid пустой"
|
||||
[ -n "$ssh_uuid" ] || ssh_uuid="$uuid"
|
||||
|
||||
out="${TMPDIR:-/tmp}/owrt-remote-client.$$"
|
||||
if [ "$stdout" = "1" ]; then
|
||||
out="${TMPDIR:-/tmp}/owrt-remote-client.$$"
|
||||
else
|
||||
xray_config_dir="$(dirname "$xray_config")"
|
||||
mkdir -p "$xray_config_dir"
|
||||
out="$xray_config_dir/.owrt-remote-client.$$"
|
||||
fi
|
||||
cat >"$out" <<EOF
|
||||
{
|
||||
"log": {
|
||||
@@ -516,10 +522,8 @@ EOF
|
||||
return
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$xray_config")"
|
||||
cp "$out" "$xray_config"
|
||||
mv -f "$out" "$xray_config"
|
||||
chmod 0600 "$xray_config"
|
||||
rm -f "$out"
|
||||
printf '%s\n' "$xray_config"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user