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