Skip to content

Commit f692fce

Browse files
authored
Update install.ubuntu.18.04.sh (haoel#120)
* Update install.ubuntu.18.04.sh 上一个 pr 漏了一个地方 修复: 添加了括号调整运算符优先级,修复对端口号的校验 修改端口号上限为 65535 * Update install.ubuntu.18.04.sh
1 parent 53ccdbd commit f692fce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/install.ubuntu.18.04.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ install_gost() {
123123
read -r -p "请输入你要使用的密码:" PASS
124124
read -r -p "请输入HTTP/2需要侦听的端口号(443):" PORT
125125

126-
if [[ -z "${PORT// }" ]] || ! [[ "${PORT}" =~ ^[0-9]+$ ]] || ! [ "$PORT" -ge 1 ] && [ "$PORT" -le 655535 ]; then
126+
if [[ -z "${PORT// }" ]] || ! [[ "${PORT}" =~ ^[0-9]+$ ]] || ! { [ "$PORT" -ge 1 ] && [ "$PORT" -le 65535 ]; }; then
127127
echo -e "${COLOR_ERROR}非法端口,使用默认端口 443 !${COLOR_NONE}"
128128
PORT=443
129129
fi
@@ -177,7 +177,7 @@ install_shadowsocks(){
177177

178178
BIND_IP=0.0.0.0
179179

180-
if [[ -z "${PORT// }" ]] || ! [[ "${PORT}" =~ ^[0-9]+$ ]] || ! ([ "$PORT" -ge 1 ] && [ "$PORT" -le 65535 ]); then
180+
if [[ -z "${PORT// }" ]] || ! [[ "${PORT}" =~ ^[0-9]+$ ]] || ! { [ "$PORT" -ge 1 ] && [ "$PORT" -le 65535 ]; }; then
181181
echo -e "${COLOR_ERROR}非法端口,使用默认端口 1984 !${COLOR_NONE}"
182182
PORT=1984
183183
fi

0 commit comments

Comments
 (0)