Commit ccdbd266f984346b4d5d1a4953473ae436cf5f61

Authored by Clang
1 parent d1355d7c
Exists in master

更新启动时端口占用检测

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
ngrokd.init
... ... @@ -89,6 +89,7 @@ fun_check_port(){
89 89 [ -n "${strHttpsPort}" ] && netstat -ntlp | grep "\b:${https_port}\b"
90 90 [ -n "${strRemotePort}" ] && netstat -ntlp | grep "\b:${remote_port}\b"
91 91 [ -n "${strManagePort}" ] && netstat -ntlp | grep "\b:${manage_port}\b"
  92 + echo "start failed"
92 93 return 1
93 94 fi
94 95 }
... ... @@ -113,9 +114,9 @@ fun_start()
113 114 echo "${ProgramName} (pid `pidof $NAME`) already running."
114 115 return 0
115 116 fi
  117 + echo -n "Starting ${ProgramName}..."
116 118 fun_check_port
117 119 fun_load_config
118   - echo -n "Starting ${ProgramName}..."
119 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 121 PID=`pidof ${NAME}`
121 122 echo $PID > $PID_FILE
... ...