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