diff --git a/shell/code.sh b/shell/code.sh index ab80556d..fadef0f9 100755 --- a/shell/code.sh +++ b/shell/code.sh @@ -5,7 +5,7 @@ dir_shell=/ql/shell . $dir_shell/share.sh ## 导入配置文件 -import_config_and_check +import_config ## 生成pt_pin清单 gen_pt_pin_array () { diff --git a/shell/rmlog.sh b/shell/rmlog.sh index 1ca603fd..bc47a089 100755 --- a/shell/rmlog.sh +++ b/shell/rmlog.sh @@ -5,7 +5,7 @@ dir_shell=/ql/shell . $dir_shell/share.sh ## 导入配置文件 -import_config_no_check rmlog +import_config days=$1 diff --git a/shell/share.sh b/shell/share.sh index b754ccad..59f3b6cc 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -45,25 +45,15 @@ original_name=( notify.sh ) -## 导入配置文件不校验 -import_config_no_check () { +## 导入配置文件 +import_config () { [ -f $file_cookie ] && . $file_cookie [ -f $file_config_user ] && . $file_config_user -} - -## 导入配置文件并校验 -import_config_and_check () { - import_config_no_check - if [[ ! -s $file_cookie ]]; then - echo -e "请先配置好Cookie...\n" - exit 1 - else - user_sum=0 - for line in $(cat $file_cookie); do - let user_sum++ - eval Cookie${user_sum}="\"$line\"" - done - fi + user_sum=0 + for line in $(cat $file_cookie); do + let user_sum++ + eval Cookie${user_sum}="\"$line\"" + done } ## 创建目录,$1:目录的绝对路径 @@ -261,4 +251,4 @@ detect_termux detect_macos define_cmd fix_config -import_config_no_check \ No newline at end of file +import_config \ No newline at end of file diff --git a/shell/task.sh b/shell/task.sh index cff19567..27ebcb4d 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -41,7 +41,7 @@ define_program () { elif [[ $p1 == *.py ]]; then which_program="python3" else - which_program="bash" + which_program="" fi } @@ -59,7 +59,7 @@ random_delay () { ## scripts目录下所有可运行脚本数组 gen_array_scripts () { - import_config_no_check + import_config local dir_current=$(pwd) local i="-1" cd $dir_scripts @@ -98,7 +98,7 @@ run_nohup () { run_normal () { local p1=$1 cd $dir_scripts - import_config_and_check + import_config define_program "$p1" combine_all if [[ $AutoHelpOther == true ]] && [[ $(ls $dir_code) ]]; then @@ -117,8 +117,8 @@ run_normal () { run_concurrent () { local p1=$1 cd $dir_scripts - import_config_and_check - define_program + import_config + define_program "$p1" make_dir $dir_log/$p1 log_time=$(date "+%Y-%m-%d-%H-%M-%S.%N") echo -e "\n各账号间已经在后台开始并发执行,前台不输入日志,日志直接写入文件中。\n"