mirror of
https://github.com/samuelhbne/server-xray.git
synced 2025-12-16 20:07:06 +03:00
Codacy compliant
This commit is contained in:
@@ -48,7 +48,7 @@ if [ -z "${serviceName}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -74,7 +74,7 @@ if [ -z "${serviceName}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
@@ -113,7 +113,7 @@ inbound=$(echo $inbound| jq -c --arg dest "${dest}" --arg pubkey "${pubkey}" --a
|
||||
'.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}')
|
||||
|
||||
# serverNames settings
|
||||
if [ -n "${serverNames[@]}" ]; then
|
||||
if [ "${#serverNames[@]}" -gt 0 ]; then
|
||||
JserverNames=$(printf '%s\n' "${serverNames[@]}"|jq -R|jq -sc)
|
||||
inbound=$(echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.streamSettings.realitySettings.serverNames += $JserverNames')
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ -z "${serviceName}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -48,7 +48,7 @@ if [ -z "${webpath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ -z "${webpath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -66,7 +66,7 @@ if [ -z "${prvkey}" ]; then
|
||||
>&2 echo -e "PublicKey: $pubkey\n"
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
@@ -105,7 +105,7 @@ inbound=$(echo $inbound| jq -c --arg dest "${dest}" --arg pubkey "${pubkey}" --a
|
||||
'.streamSettings.realitySettings += {"show":true,"dest":"\($dest):443","serverNames":[$dest],"privateKey":$prvkey,"publicKey":$pubkey}')
|
||||
|
||||
# serverNames settings
|
||||
if [ -n "${serverNames[@]}" ]; then
|
||||
if [ "${#serverNames[@]}" -gt 0 ]; then
|
||||
JserverNames=$(printf '%s\n' "${serverNames[@]}"|jq -R|jq -sc)
|
||||
inbound=$(echo $inbound| jq -c --argjson JserverNames "${JserverNames}" '.streamSettings.realitySettings.serverNames += $JserverNames')
|
||||
fi
|
||||
|
||||
@@ -54,7 +54,7 @@ if [ -z "${port}" ]; then
|
||||
usage; exit 1 ;
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -48,7 +48,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -54,7 +54,7 @@ if [ -z "${port}" ]; then
|
||||
usage; exit 1 ;
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -48,7 +48,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -104,7 +104,7 @@ options=($(echo $STSVR |tr ',' ' '))
|
||||
esac
|
||||
done
|
||||
# Naming the upstream as yahoo_com_jp for SNI yahoo.com.jp
|
||||
upsname=$(echo "${sni//\./_}")
|
||||
upsname="${sni//\./_}"
|
||||
echo " $sni $upsname;" >>/tmp/stmap.conf
|
||||
echo " upstream $upsname {" >>/tmp/stups.conf
|
||||
echo " server $upstream;" >>/tmp/stups.conf
|
||||
|
||||
@@ -54,7 +54,7 @@ if [ -z "${port}" ]; then
|
||||
usage; exit 1 ;
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -48,7 +48,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ -z "${wspath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
if [ "${#xuser[@]}" -eq 0 ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user