mirror of
https://github.com/samuelhbne/server-xray.git
synced 2025-12-16 20:07:06 +03:00
Port numeric check
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user