fix test run
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
args=$@
|
||||
is_sh_ver=v1.17
|
||||
is_sh_ver=v1.18
|
||||
|
||||
. /etc/sing-box/sh/src/init.sh
|
||||
+3
-3
@@ -771,7 +771,7 @@ manage() {
|
||||
fi
|
||||
[[ $is_test_run && ! $is_new_install ]] && {
|
||||
sleep 2
|
||||
if [[ ! $(pgrep -f $is_run_bin 2>/dev/null || grep -l "$is_run_bin" /proc/*/cmdline 2>/dev/null) ]]; then
|
||||
if [[ ! $(pgrep -f $is_run_bin) ]]; then
|
||||
is_run_fail=${is_do_name_msg,,}
|
||||
[[ ! $is_no_manage_msg ]] && {
|
||||
msg
|
||||
@@ -1324,7 +1324,7 @@ get() {
|
||||
}
|
||||
fi
|
||||
is_no_manage_msg=1
|
||||
if [[ ! $(pgrep -f $is_core_bin 2>/dev/null || grep -l "$is_core_bin" /proc/*/cmdline 2>/dev/null) ]]; then
|
||||
if [[ ! $(pgrep -f $is_core_bin) ]]; then
|
||||
_yellow "\n测试运行 $is_core_name ..\n"
|
||||
manage start &>/dev/null
|
||||
if [[ $is_run_fail == $is_core ]]; then
|
||||
@@ -1337,7 +1337,7 @@ get() {
|
||||
_green "\n$is_core_name 正在运行, 跳过测试\n"
|
||||
fi
|
||||
if [[ $is_caddy ]]; then
|
||||
if [[ ! $(pgrep -f $is_caddy_bin 2>/dev/null || grep -l "$is_caddy_bin" /proc/*/cmdline 2>/dev/null) ]]; then
|
||||
if [[ ! $(pgrep -f $is_caddy_bin) ]]; then
|
||||
_yellow "\n测试运行 Caddy ..\n"
|
||||
manage start caddy &>/dev/null
|
||||
if [[ $is_run_fail == 'caddy' ]]; then
|
||||
|
||||
+2
-2
@@ -115,7 +115,7 @@ is_tls_key=$is_core_dir/bin/tls.key
|
||||
rm $is_tls_tmp
|
||||
}
|
||||
|
||||
if [[ $(pgrep -f $is_core_bin 2>/dev/null || grep -l "$is_core_bin" /proc/*/cmdline 2>/dev/null) ]]; then
|
||||
if [[ $(pgrep -f $is_core_bin) ]]; then
|
||||
is_core_status=$(_green running)
|
||||
else
|
||||
is_core_status=$(_red_bg stopped)
|
||||
@@ -135,7 +135,7 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
|
||||
is_tmp_https_port=$(grep -E '^ {2,}https_port|^https_port' $is_caddyfile | grep -E -o [0-9]+)
|
||||
[[ $is_tmp_http_port ]] && is_http_port=$is_tmp_http_port
|
||||
[[ $is_tmp_https_port ]] && is_https_port=$is_tmp_https_port
|
||||
if [[ $(pgrep -f $is_caddy_bin 2>/dev/null || grep -l "$is_caddy_bin" /proc/*/cmdline 2>/dev/null) ]]; then
|
||||
if [[ $(pgrep -f $is_caddy_bin) ]]; then
|
||||
is_caddy_status=$(_green running)
|
||||
else
|
||||
is_caddy_status=$(_red_bg stopped)
|
||||
|
||||
Reference in New Issue
Block a user