Codacy compliant

This commit is contained in:
Samuel Huang
2024-10-01 00:15:33 +10:00
parent 3ae14cfa24
commit c1f71bf1bb
18 changed files with 73 additions and 129 deletions

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]"
}
IFS=',' read -a options <<< "$1"
IFS=',' read -ra options <<< "$1"
for option in "${options[@]}"
do
IFS='=' read -a kv <<< "$option"
IFS='=' read -ra kv <<< "$option"
case "${kv[0]}" in
c|certhome)
certhome="${kv[1]}"
@@ -81,7 +81,7 @@ inbound=$(jq -nc --arg port "${port}" '{"port":($port|tonumber),"protocol":"vmes
# User settings
for user in "${xuser[@]}"
do
IFS=':'; uopt=(${user}); uopt=(${uopt[@]})
IFS=':'; uopt=("${user}"); uopt=("${uopt[@]}")
uid="${uopt[0]}"; level="${uopt[1]}"; email="${uopt[2]}"
unset IFS
if [ -z "${uid}" ]; then >&2 echo -e "Incorrect user format: $user\n"; usage; exit 1; fi
@@ -120,5 +120,5 @@ do
inbound=$(echo $inbound| jq -c --argjson Jfb "${Jfb}" '.settings.fallbacks += [$Jfb]')
done
echo $inbound
echo "$inbound"
exit 0