修复task命令参数引入

This commit is contained in:
whyour 2021-05-04 13:17:08 +08:00
parent 082acc2fb5
commit 34775dd14d
4 changed files with 15 additions and 25 deletions

View File

@ -5,7 +5,7 @@ dir_shell=/ql/shell
. $dir_shell/share.sh . $dir_shell/share.sh
## 导入配置文件 ## 导入配置文件
import_config_and_check import_config
## 生成pt_pin清单 ## 生成pt_pin清单
gen_pt_pin_array () { gen_pt_pin_array () {

View File

@ -5,7 +5,7 @@ dir_shell=/ql/shell
. $dir_shell/share.sh . $dir_shell/share.sh
## 导入配置文件 ## 导入配置文件
import_config_no_check rmlog import_config
days=$1 days=$1

View File

@ -45,25 +45,15 @@ original_name=(
notify.sh notify.sh
) )
## 导入配置文件不校验 ## 导入配置文件
import_config_no_check () { import_config () {
[ -f $file_cookie ] && . $file_cookie [ -f $file_cookie ] && . $file_cookie
[ -f $file_config_user ] && . $file_config_user [ -f $file_config_user ] && . $file_config_user
} user_sum=0
for line in $(cat $file_cookie); do
## 导入配置文件并校验 let user_sum++
import_config_and_check () { eval Cookie${user_sum}="\"$line\""
import_config_no_check done
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
} }
## 创建目录,$1目录的绝对路径 ## 创建目录,$1目录的绝对路径
@ -261,4 +251,4 @@ detect_termux
detect_macos detect_macos
define_cmd define_cmd
fix_config fix_config
import_config_no_check import_config

View File

@ -41,7 +41,7 @@ define_program () {
elif [[ $p1 == *.py ]]; then elif [[ $p1 == *.py ]]; then
which_program="python3" which_program="python3"
else else
which_program="bash" which_program=""
fi fi
} }
@ -59,7 +59,7 @@ random_delay () {
## scripts目录下所有可运行脚本数组 ## scripts目录下所有可运行脚本数组
gen_array_scripts () { gen_array_scripts () {
import_config_no_check import_config
local dir_current=$(pwd) local dir_current=$(pwd)
local i="-1" local i="-1"
cd $dir_scripts cd $dir_scripts
@ -98,7 +98,7 @@ run_nohup () {
run_normal () { run_normal () {
local p1=$1 local p1=$1
cd $dir_scripts cd $dir_scripts
import_config_and_check import_config
define_program "$p1" define_program "$p1"
combine_all combine_all
if [[ $AutoHelpOther == true ]] && [[ $(ls $dir_code) ]]; then if [[ $AutoHelpOther == true ]] && [[ $(ls $dir_code) ]]; then
@ -117,8 +117,8 @@ run_normal () {
run_concurrent () { run_concurrent () {
local p1=$1 local p1=$1
cd $dir_scripts cd $dir_scripts
import_config_and_check import_config
define_program define_program "$p1"
make_dir $dir_log/$p1 make_dir $dir_log/$p1
log_time=$(date "+%Y-%m-%d-%H-%M-%S.%N") log_time=$(date "+%Y-%m-%d-%H-%M-%S.%N")
echo -e "\n各账号间已经在后台开始并发执行前台不输入日志日志直接写入文件中。\n" echo -e "\n各账号间已经在后台开始并发执行前台不输入日志日志直接写入文件中。\n"