Commit ccdbd266f984346b4d5d1a4953473ae436cf5f61

Authored by Clang
1 parent d1355d7c
Exists in master

更新启动时端口占用检测

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
@@ -89,6 +89,7 @@ fun_check_port(){ @@ -89,6 +89,7 @@ fun_check_port(){
89 [ -n "${strHttpsPort}" ] && netstat -ntlp | grep "\b:${https_port}\b" 89 [ -n "${strHttpsPort}" ] && netstat -ntlp | grep "\b:${https_port}\b"
90 [ -n "${strRemotePort}" ] && netstat -ntlp | grep "\b:${remote_port}\b" 90 [ -n "${strRemotePort}" ] && netstat -ntlp | grep "\b:${remote_port}\b"
91 [ -n "${strManagePort}" ] && netstat -ntlp | grep "\b:${manage_port}\b" 91 [ -n "${strManagePort}" ] && netstat -ntlp | grep "\b:${manage_port}\b"
  92 + echo "start failed"
92 return 1 93 return 1
93 fi 94 fi
94 } 95 }
@@ -113,9 +114,9 @@ fun_start() @@ -113,9 +114,9 @@ fun_start()
113 echo "${ProgramName} (pid `pidof $NAME`) already running." 114 echo "${ProgramName} (pid `pidof $NAME`) already running."
114 return 0 115 return 0
115 fi 116 fi
  117 + echo -n "Starting ${ProgramName}..."
116 fun_check_port 118 fun_check_port
117 fun_load_config 119 fun_load_config
118 - echo -n "Starting ${ProgramName}..."  
119 ${BIN} -domain="$dns" -httpAddr=":$http_port" -httpsAddr=":$https_port" -pass="$pass" -tlsCrt="$srtCRT" -tlsKey="$strKey" -tunnelAddr=":$remote_port"${log_level} > ${LOGFILE} 2>&1 & 120 ${BIN} -domain="$dns" -httpAddr=":$http_port" -httpsAddr=":$https_port" -pass="$pass" -tlsCrt="$srtCRT" -tlsKey="$strKey" -tunnelAddr=":$remote_port"${log_level} > ${LOGFILE} 2>&1 &
120 PID=`pidof ${NAME}` 121 PID=`pidof ${NAME}`
121 echo $PID > $PID_FILE 122 echo $PID > $PID_FILE