@@ -43,7 +43,7 @@ start_bbr(){
4343
4444install_bbr () {
4545 # 如果内核版本号满足最小要求
46- if [ $VERSION_CURR > $VERSION_MIN ]; then
46+ if [[ $VERSION_CURR > $VERSION_MIN ] ]; then
4747 check_bbr
4848 else
4949 update_core
@@ -118,12 +118,12 @@ install_gost() {
118118 fi
119119
120120 echo " 准备启动 Gost 代理程序,为了安全,需要使用用户名与密码进行认证."
121- read -p " 请输入你要使用的域名:" DOMAIN
122- read -p " 请输入你要使用的用户名:" USER
123- read -p " 请输入你要使用的密码:" PASS
124- read -p " 请输入HTTP/2需要侦听的端口号(443):" PORT
121+ read -r - p " 请输入你要使用的域名:" DOMAIN
122+ read -r - p " 请输入你要使用的用户名:" USER
123+ read -r - p " 请输入你要使用的密码:" PASS
124+ read -r - p " 请输入HTTP/2需要侦听的端口号(443):" PORT
125125
126- if [[ -z " ${PORT// } " ]] || ! [[ " ${PORT} " =~ ^[0-9]+$ ]] || ! [ " $PORT " -ge 1 -a " $PORT " -le 655535 ]; then
126+ if [[ -z " ${PORT// } " ]] || ! [[ " ${PORT} " =~ ^[0-9]+$ ]] || ! [ " $PORT " -ge 1 ] && [ " $PORT " -le 655535 ]; then
127127 echo -e " ${COLOR_ERROR} 非法端口,使用默认端口 443 !${COLOR_NONE} "
128128 PORT=443
129129 fi
@@ -172,12 +172,12 @@ install_shadowsocks(){
172172 fi
173173
174174 echo " 准备启动 ShadowSocks 代理程序,为了安全,需要使用用户名与密码进行认证."
175- read -p " 请输入你要使用的密码:" PASS
176- read -p " 请输入ShadowSocks需要侦听的端口号(1984):" PORT
175+ read -r - p " 请输入你要使用的密码:" PASS
176+ read -r - p " 请输入ShadowSocks需要侦听的端口号(1984):" PORT
177177
178178 BIND_IP=0.0.0.0
179179
180- if [[ -z " ${PORT// } " ]] || ! [[ " ${PORT} " =~ ^[0-9]+$ ]] || ! [ " $PORT " -ge 1 -a " $PORT " -le 655535 ]; then
180+ if [[ -z " ${PORT// } " ]] || ! [[ " ${PORT} " =~ ^[0-9]+$ ]] || ! [ " $PORT " -ge 1 ] && [ " $PORT " -le 655535 ]; then
181181 echo -e " ${COLOR_ERROR} 非法端口,使用默认端口 1984 !${COLOR_NONE} "
182182 PORT=1984
183183 fi
@@ -232,7 +232,7 @@ init(){
232232 COLUMNS=50
233233 echo -e " \n菜单选项\n"
234234
235- while [ 1 == 1 ]
235+ while true
236236 do
237237 PS3=" Please select a option:"
238238 re=' ^[0-9]+$'
@@ -257,7 +257,7 @@ init(){
257257 break
258258 elif (( REPLY == 3 )) ; then
259259 create_cert
260- loop=1
260+ # loop=1
261261 break
262262 elif (( REPLY == 4 )) ; then
263263 install_gost
@@ -282,7 +282,8 @@ init(){
282282 done
283283 done
284284
285- IFS=$OIFS # Restore the IFS
285+ echo " ${opt} "
286+ IFS=$OIFS # Restore the IFS
286287}
287288
288289init
0 commit comments