Port numeric check

This commit is contained in:
Samuel Huang
2021-08-17 12:15:37 +10:00
parent f0ace75173
commit 9b82aa5247
8 changed files with 18 additions and 1 deletions

View File

@@ -60,6 +60,8 @@ if [ -z "${xuser}" ]; then
exit 1
fi
if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi
XCONF=$xconf
cat $XCONF |jq --arg port "${port}" '.inbounds +=[{"port":($port|tonumber), "protocol":"vless", "settings":{"clients":[]}}]' |sponge $XCONF