From a10ffef38fc03af6557e781c9abd5c21c2ffb5c3 Mon Sep 17 00:00:00 2001 From: whyour Date: Wed, 2 Mar 2022 21:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtask=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/task.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/task.sh b/shell/task.sh index 088d4ebb..b9bf9a92 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -143,6 +143,7 @@ run_concurrent() { done local cookieStr=$(echo ${array_run[*]} | sed 's/\ /\&/g') + [[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr} define_program "$first_param" log_time=$(date "+%Y-%m-%d-%H-%M-%S") @@ -166,8 +167,6 @@ run_concurrent() { [[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path" "$begin_timestamp" eval . $file_task_before "$@" $cmd - [[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr} - local envs=$(eval echo "\$${env_param}") local array=($(echo $envs | sed 's/&/ /g')) single_log_time=$(date "+%Y-%m-%d-%H-%M-%S.%N") @@ -236,6 +235,7 @@ run_designated() { done local cookieStr=$(echo ${array_run[*]} | sed 's/\ /\&/g') + [[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr} eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd [[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd @@ -244,8 +244,6 @@ run_designated() { [[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path" "$begin_timestamp" eval . $file_task_before "$@" $cmd - [[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr} - cd $dir_scripts local relative_path="${file_param%/*}" if [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then