From 6d75cf54b8dafead941db674f65347a6b648b12b Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 22 Mar 2021 22:24:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCookie=E7=BB=84=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/jd.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shell/jd.sh b/shell/jd.sh index b16fb828..c0e330cf 100755 --- a/shell/jd.sh +++ b/shell/jd.sh @@ -21,7 +21,7 @@ function Import_Conf { then . ${CookieConf} . ${FileConf} - if [ ! -s ${CookieConf} ]; then + if [[ ! -s ${CookieConf} ]]; then echo -e "请先在Cookie管理中添加一条Cookie...\n" exit 1 fi @@ -40,10 +40,11 @@ function Detect_Cron { ## 用户数量UserSum function Count_UserSum { - for ((i=1; i<=1000; i++)); do - Tmp=Cookie$i - CookieTmp=${!Tmp} - [[ ${CookieTmp} ]] && UserSum=$i || break + UserSum=0 + for line in `cat $CookieConf` + do + ((UserSum++)) + eval Cookie${UserSum}="\"${line}\"" done } @@ -280,4 +281,4 @@ case $# in echo -e "\n命令过多...\n" Help ;; -esac +esac \ No newline at end of file