X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=autodlctl;h=b3c914c60fb6b6d6e497e97ceab8cb24e5a33da0;hb=7af242aa72215ae94dcff92fe22b76c6cf662592;hp=1215c65a45f9e978dc5d9f39977033f50e66e3e7;hpb=ccc141a39e09ba0ddd163e953a642beb002cccef;p=utils.git diff --git a/autodlctl b/autodlctl index 1215c65..b3c914c 100755 --- a/autodlctl +++ b/autodlctl @@ -18,11 +18,12 @@ function getnext else echo "no available episode of $tag" >&2 echo "$tag" >>"$HOME/dc/autodl/faulty" + touch "$d/.autodl/disabled" return 1 fi unset badsizesl if [ -r "$d/.autodl/badsizes" ]; then - badsizesl="$(sed -n "s/^0*$curep \(.*\)$/\1/p" "$d/.autodl/badsizes")" + badsizesl="$(sed -n "s/^0*$curep \([^#]*\)\( *#.*\)\?$/\1/p" "$d/.autodl/badsizes")" fi if [ -n "$badsizesl" ]; then read -a badsizes <<<"$badsizesl" @@ -37,7 +38,11 @@ function getnext done fi infofile="$d/.autodl/rtinfo" - args=(-e "$fsexpr" -t "$tag $curep" -I "$infofile") + estatfile="$d/.autodl/estat" + args=(-e "$fsexpr" -t "$tag $curep" -I "$infofile" -E "$estatfile" -x "curep=$curep") + if [ -e "$d/.autodl/wait" ]; then + args=("${args[@]}" -w) + fi if [ -r "$d/.autodl/uarg" ]; then uarg="`cat "$d/.autodl/uarg"`" elif [ -e "$d/.autodl/autouarg" ]; then @@ -55,6 +60,10 @@ function getnext trap "intr=y; kill -INT $pid" USR1 INT wait $pid stat=$? + if [ -r "$estatfile" ]; then + estat="`cat "$estatfile"`" + rm -f "$estatfile" + fi if [ "$intr" = y ]; then echo "$tag interrupted" else @@ -71,7 +80,7 @@ function getnext echo "$tag" >>"$HOME/dc/autodl/faulty" fi else - echo "episode $curep of $tag done" + echo "episode $curep of $tag done (estat: \"$estat\")" case "$epfrom" in badlist) echo -en "${tag}\n${curep}\n" >>"$HOME/dc/autodl/baddone" @@ -91,8 +100,14 @@ function getnext fi ;; curep) - echo -en "${tag}\n${curep}\n" >>"$HOME/dc/autodl/done" - let curep++ + if [ "$estat" = dbl ]; then + echo -en "${tag}\n${curep}\n" >>"$HOME/dc/autodl/done" + echo -en "${tag}\n$((${curep} + 1))\n" >>"$HOME/dc/autodl/done" + let curep+=2 + else + echo -en "${tag}\n${curep}\n" >>"$HOME/dc/autodl/done" + let curep++ + fi echo "$curep" >"$d/.autodl/curep" if [ -r "$d/.autodl/maxep" ]; then if [ "$curep" -gt "`cat "$d/.autodl/maxep"`" ]; then