mirror of
https://github.com/samuelhbne/server-xray.git
synced 2025-12-17 20:34:39 +03:00
Codacy compliant
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR=$(dirname $0)
|
||||
|
||||
usage() {
|
||||
>&2 echo -e "VLESS-SPLT-TLS server builder"
|
||||
>&2 echo -e "Usage: server-lst <w=webpath>,<c=certhome-dir>,<d=domain.com>,<p=listen-port>,<u=id0>,<u=id1>...,[proxy_acpt],[fallback=host:port:path],[xtls]"
|
||||
@@ -64,7 +62,7 @@ if [ -z "${webpath}" ]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
if [ -z "${xuser[@]}" ]; then
|
||||
>&2 echo -e "Error: User undefined.\n"
|
||||
usage; exit 1
|
||||
fi
|
||||
@@ -111,7 +109,7 @@ do
|
||||
IFS=':'; fopt=(${fb}); fopt=(${fopt[@]})
|
||||
fhost="${fopt[0]}"; fport="${fopt[1]}"; fpath="${fopt[2]}"
|
||||
unset IFS
|
||||
if [ -z "${fport}" ]; then >&2 echo -e "Incorrect fallback format: ${fallback}\n"; usage; exit 1; fi
|
||||
if [ -z "${fport}" ]; then >&2 echo -e "Incorrect fallback format: $fb\n"; usage; exit 1; fi
|
||||
if [ -z "${fhost}" ]; then fhost="127.0.0.1"; fi
|
||||
fdest="$fhost:$fport"
|
||||
Jfb=$(jq -nc --arg fdest "${fdest}" --arg fpath "${fpath}" '. |= {"dest":$fdest,"path":$fpath,"xver":1}')
|
||||
|
||||
Reference in New Issue
Block a user