Codacy compliant

This commit is contained in:
Samuel Huang
2024-09-30 22:09:01 +10:00
parent 1c27e9d340
commit 8d2a35c53e
16 changed files with 18 additions and 18 deletions

View File

@@ -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