Skip to content

Commit 9858139

Browse files
committed
v1.15.0版本新特性
- 🍉支持阿里云DCDN - 🍇支持百度智能云CDN加速 - 🍍支持腾讯云-边缘安全加速平台(EdgeOne) - 🥕支持火山引擎CDN、OSS - 🍏支持白山云CDN - 🍓解决nginx当前服务器状态不可用问题 - 🍍自动申请证书,使用上次成功的配置 - 🍒解决IIS证书问题(需要低版本openssl支持) - 🍠支持Ak列表提示 - 🌽支持推送小程序查看详情 - 🥬支持WebHook - 🍅解决历史数据导致证书列表无法查看问题 - 🍋重构自动部署,增加产品ID概念 - 🧅解决证书监控没有推送的问题 - 🫑完善自动部署、申请失败详情问题 - 🥝优化证书监控分页-排序问题(即将过期的排在前面) - 🫐支持nginx_bin配置(适配THS服务) - 🥬支持付费版本、分享赠送
1 parent 9feba4d commit 9858139

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

httpsok.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
# Try to visit WIKI to find a solution.
88

99
################################################
10+
NGINX_BIN=nginx
1011
# NGINX_CONFIG=/etc/nginx/nginx.conf
1112
# NGINX_CONFIG_HOME=/etc/nginx
1213
##################################################
1314

14-
VER=1.14.0
15+
VER=1.15.0
1516

1617
PROJECT_NAME="httpsok"
1718
PROJECT_ENTRY="httpsok.sh"
@@ -166,27 +167,27 @@ _initparams() {
166167
exit 1
167168
fi
168169

169-
nginx_bin=nginx
170-
$nginx_bin -V > /dev/null 2>&1
170+
# NGINX_BIN=nginx
171+
$NGINX_BIN -V > /dev/null 2>&1
171172
if [ $? -ne 0 ]; then
172173
echo "no nginx in PATH, find the nginx"
173174
pid=$(ps -e | grep nginx | grep -v 'grep' | head -n 1 | awk '{print $1}')
174175
if [ -n "$pid" ]; then
175-
nginx_bin=$(readlink -f /proc/"$pid"/exe)
176-
# echo "nginx_bin=$nginx_bin"
176+
NGINX_BIN=$(readlink -f /proc/"$pid"/exe)
177+
# echo "NGINX_BIN=$NGINX_BIN"
177178
# again to verify
178-
$nginx_bin -V > /dev/null 2>&1
179+
$NGINX_BIN -V > /dev/null 2>&1
179180
if [ $? -ne 0 ]; then
180181
_no_nginx_here
181182
else
182-
echo "Nginx executable path: $nginx_bin"
183+
echo "Nginx executable path: $NGINX_BIN"
183184
fi
184185
else
185186
_no_nginx_here
186187
fi
187188
fi
188189

189-
NGINX_VERSION=$($nginx_bin -v 2>&1 | awk -F ': ' '{print $2}' | head -c 20)
190+
NGINX_VERSION=$($NGINX_BIN -v 2>&1 | awk -F ': ' '{print $2}' | head -c 20)
190191

191192
# user can setting
192193
if [ -z "$NGINX_CONFIG" ]; then
@@ -196,7 +197,7 @@ _initparams() {
196197

197198
# fix the NGINX_CONFIG equals nginx.conf bug
198199
if [ -z "$NGINX_CONFIG" ] || [ "$NGINX_CONFIG" = "nginx.conf" ]; then
199-
NGINX_CONFIG=$($nginx_bin -t 2>&1 | grep 'configuration' | head -n 1 | awk -F 'file' '{print $2}' | awk '{print $1}' )
200+
NGINX_CONFIG=$($NGINX_BIN -t 2>&1 | grep 'configuration' | head -n 1 | awk -F 'file' '{print $2}' | awk '{print $1}' )
200201
fi
201202

202203
if [ -z "$NGINX_CONFIG_HOME" ]; then
@@ -209,7 +210,7 @@ _initparams() {
209210
_info "version: $NGINX_VERSION"
210211
_info "nginx-config: $NGINX_CONFIG"
211212
_info "nginx-config-home: $NGINX_CONFIG_HOME"
212-
_info "nginx-bin: $nginx_bin"
213+
_info "nginx-bin: $NGINX_BIN"
213214
_info "httpsok-uuid: $HTTPSOK_UUID"
214215

215216

@@ -686,14 +687,14 @@ _reload_nginx() {
686687
# fixbug: signal process started
687688
cd $NGINX_CONFIG_HOME
688689

689-
msg=$($nginx_bin -t 2>&1)
690+
msg=$($NGINX_BIN -t 2>&1)
690691
if [ $? != 0 ]; then
691692
_remote_log "nginx-test-failed" "$latest_code" "$msg"
692693
echo
693694
_err "Nginx test failed. \n\n$msg"
694695
else
695-
msg=$($nginx_bin -s reload 2>&1)
696-
if [ "$msg" = "" ]; then
696+
msg=$($NGINX_BIN -s reload 2>&1)
697+
if [ $? -eq 0 ]; then
697698
_remote_log "nginx-reload-success" "$latest_code" "Nginx reload success."
698699
echo
699700
_suc "Nginx reload success."

0 commit comments

Comments
 (0)