From 908a5717ac97c764d4c34648370e162f9cdb449b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 17 Aug 2021 01:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=EF=B8=8Fsync=202021-08-17=2001:28:?= =?UTF-8?q?20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/sh/Helpcode2.8/code.sh | 7 +++++-- Scripts/sh/Helpcode2.8/task_before.sh | 10 ++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Scripts/sh/Helpcode2.8/code.sh b/Scripts/sh/Helpcode2.8/code.sh index 912679d..0d7ee50 100644 --- a/Scripts/sh/Helpcode2.8/code.sh +++ b/Scripts/sh/Helpcode2.8/code.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -## Build 20210816-001 +## Build 20210817-001 ## 导入通用变量与函数 dir_shell=/ql/shell @@ -668,9 +668,12 @@ install_dependencies_all(){ done } +kill_proc(){ +ps -ef|grep "$1"|grep -Ev "$2"|awk '{print $1}'|xargs kill -9 +} ## 执行并写入日志 -ps -ef|grep "code.sh"|grep -Ev "grep|$$"|awk '{print $1}'|xargs kill -9 >/dev/null 2>&1 +kill_proc "code.sh" "grep|$$" >/dev/null 2>&1 [[ $FixDependType = "1" ]] && [[ "$ps_num" -le $proc_num ]] && install_dependencies_all >/dev/null 2>&1 & latest_log=$(ls -r $dir_code | head -1) latest_log_path="$dir_code/$latest_log" diff --git a/Scripts/sh/Helpcode2.8/task_before.sh b/Scripts/sh/Helpcode2.8/task_before.sh index b4efc5a..1bfec62 100644 --- a/Scripts/sh/Helpcode2.8/task_before.sh +++ b/Scripts/sh/Helpcode2.8/task_before.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Build 20210815-002 +# Build 20210817-001 p1=$1 @@ -173,13 +173,7 @@ team_task(){ result=$(echo -e "$COOKIES_HEAD$COOKIES") if [[ $result ]]; then export JD_COOKIE=$result - if [[ ${#activityId[*]} -gt 0 ]]; then - for ((k=0; k<=${#activityId[*]}; k++)); do - node /ql/scripts/$scr - done - else - node /ql/scripts/$scr - fi + node /ql/scripts/$scr fi # echo $JD_COOKIE done