diff --git a/server-lgp.sh b/server-lgp.sh index 4a735f4..c161290 100755 --- a/server-lgp.sh +++ b/server-lgp.sh @@ -58,7 +58,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -75,14 +75,14 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.settings.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` +inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"none"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"none"}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lgr.sh b/server-lgr.sh index 9d3ad26..cf64967 100755 --- a/server-lgr.sh +++ b/server-lgr.sh @@ -84,7 +84,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -101,28 +101,28 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.settings.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` +inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"reality"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"reality"}'` # Reality settings inbound=`echo $inbound| jq -c --arg dest "${dest}" --arg pubkey "${pubkey}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}'` +'.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}'` # serverNames settings if [ -n "${serverNames}" ]; then JserverNames=`printf '%s\n' "${serverNames[@]}"|jq -R|jq -sc` - inbound=`echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.settings.streamSettings.realitySettings.serverNames += $JserverNames'` + inbound=`echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.streamSettings.realitySettings.serverNames += $JserverNames'` fi # shortIds settings JshortIds=`printf '%s\n' "${shortIds[@]}"|jq -R|jq -sc` -inbound=`echo $inbound| jq -c --argjson JshortIds "${JshortIds}" '.settings.streamSettings.realitySettings.shortIds += $JshortIds'` +inbound=`echo $inbound| jq -c --argjson JshortIds "${JshortIds}" '.streamSettings.realitySettings.shortIds += $JshortIds'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lgt.sh b/server-lgt.sh index 46c93f8..55594a7 100755 --- a/server-lgt.sh +++ b/server-lgt.sh @@ -77,7 +77,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -94,16 +94,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.settings.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` +inbound=`echo $inbound| jq -c --arg serviceName "${serviceName}" '.streamSettings += {"network":"grpc","grpcSettings":{"serviceName":$serviceName}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lsp.sh b/server-lsp.sh index bef5731..ff51635 100755 --- a/server-lsp.sh +++ b/server-lsp.sh @@ -58,7 +58,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -75,14 +75,14 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg webpath "${webpath}" '.settings.streamSettings += {"network":"splithttp","splithttpSettings":{"path":$webpath}}'` +inbound=`echo $inbound| jq -c --arg webpath "${webpath}" '.streamSettings += {"network":"splithttp","splithttpSettings":{"path":$webpath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"none"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"none"}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lst.sh b/server-lst.sh index 717554b..9bc8773 100755 --- a/server-lst.sh +++ b/server-lst.sh @@ -77,7 +77,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -94,16 +94,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg webpath "${webpath}" '.settings.streamSettings += {"network":"splithttp","splithttpSettings":{"path":$webpath}}'` +inbound=`echo $inbound| jq -c --arg webpath "${webpath}" '.streamSettings += {"network":"splithttp","splithttpSettings":{"path":$webpath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-ltr.sh b/server-ltr.sh index 2540427..158ce59 100755 --- a/server-ltr.sh +++ b/server-ltr.sh @@ -76,7 +76,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -93,28 +93,28 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"network":"tcp"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"network":"tcp"}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"reality"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"reality"}'` # Reality settings inbound=`echo $inbound| jq -c --arg dest "${dest}" --arg pubkey "${pubkey}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}'` +'.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}'` # serverNames settings if [ -n "${serverNames}" ]; then JserverNames=`printf '%s\n' "${serverNames[@]}"|jq -R|jq -sc` - inbound=`echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.settings.streamSettings.realitySettings.serverNames += $JserverNames'` + inbound=`echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.streamSettings.realitySettings.serverNames += $JserverNames'` fi # shortIds settings JshortIds=`printf '%s\n' "${shortIds[@]}"|jq -R|jq -sc` -inbound=`echo $inbound| jq -c --argjson JshortIds "${JshortIds}" '.settings.streamSettings.realitySettings.shortIds += $JshortIds'` +inbound=`echo $inbound| jq -c --argjson JshortIds "${JshortIds}" '.streamSettings.realitySettings.shortIds += $JshortIds'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-ltt.sh b/server-ltt.sh index f2edd12..d2285b6 100755 --- a/server-ltt.sh +++ b/server-ltt.sh @@ -69,7 +69,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -86,16 +86,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"network":"tcp"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"network":"tcp"}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lwp.sh b/server-lwp.sh index e1053bb..3a0ecd8 100755 --- a/server-lwp.sh +++ b/server-lwp.sh @@ -58,7 +58,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -75,14 +75,14 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"none"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"none"}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-lwt.sh b/server-lwt.sh index 0220c82..5161112 100755 --- a/server-lwt.sh +++ b/server-lwt.sh @@ -77,7 +77,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vless","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vless","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -94,16 +94,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-mtt.sh b/server-mtt.sh index c74be04..c5fcc3c 100755 --- a/server-mtt.sh +++ b/server-mtt.sh @@ -69,7 +69,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vmess","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vmess","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -86,16 +86,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"network":"tcp"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"network":"tcp"}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-mwp.sh b/server-mwp.sh index 17ca14e..f89f802 100755 --- a/server-mwp.sh +++ b/server-mwp.sh @@ -58,7 +58,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vmess","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vmess","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -75,14 +75,14 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"none"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"none"}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-mwt.sh b/server-mwt.sh index d790450..9b3f9cd 100755 --- a/server-mwt.sh +++ b/server-mwt.sh @@ -77,7 +77,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"vmess","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vmess","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -94,16 +94,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-ttt.sh b/server-ttt.sh index 3aa8047..186c583 100755 --- a/server-ttt.sh +++ b/server-ttt.sh @@ -69,7 +69,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Error: Port number must be numeric.\n"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"trojan","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"trojan","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -86,16 +86,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"network":"tcp"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"network":"tcp"}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-twp.sh b/server-twp.sh index 01f5104..2cf0112 100755 --- a/server-twp.sh +++ b/server-twp.sh @@ -58,7 +58,7 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"trojan","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"trojan","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -75,14 +75,14 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"none"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"none"}'` # Fallback settings for fb in "${fallback[@]}" diff --git a/server-twt.sh b/server-twt.sh index 248e607..4d01f25 100755 --- a/server-twt.sh +++ b/server-twt.sh @@ -77,7 +77,7 @@ if [ ! -f "${prvkey}" ]; then >&2 echo "Warning, Private key not found: ${prvkey if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi # inbound frame -inbound=`jq -nc --arg port "${port}" '{"port":$port,"protocol":"trojan","settings":{"decryption":"none"}}'` +inbound=`jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"trojan","settings":{"decryption":"none"}}'` # User settings for user in "${xuser[@]}" @@ -94,16 +94,16 @@ done # StreamSettings if [ -n "${acceptProxyProtocol}" ]; then - inbound=`echo $inbound| jq -c '.settings.streamSettings.sockopt += {"acceptProxyProtocol":true}'` + inbound=`echo $inbound| jq -c '.streamSettings.sockopt += {"acceptProxyProtocol":true}'` fi # Network settings -inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.settings.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` +inbound=`echo $inbound| jq -c --arg wspath "${wspath}" '.streamSettings += {"network":"ws","wsSettings":{"path":$wspath}}'` # Security settings -inbound=`echo $inbound| jq -c '.settings.streamSettings += {"security":"tls"}'` +inbound=`echo $inbound| jq -c '.streamSettings += {"security":"tls"}'` inbound=`echo $inbound| jq -c --arg fullchain "${fullchain}" --arg prvkey "${prvkey}" \ -'.settings.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` +'.streamSettings.tlsSettings += {"certificates":[{"certificateFile":$fullchain,"keyFile":$prvkey}]}'` # Fallback settings for fb in "${fallback[@]}"