X-Git-Url: http://dolda2000.com/gitweb/?p=utils.git;a=blobdiff_plain;f=autodlctl;h=1b52a58a5a41ab60ecd5848f2013800b05dd3610;hp=6bac7514c677696d89169713bfe6cd9e0b37ddf5;hb=8c73da6800dfbdbf2d74d286db7f9ffe62c211c7;hpb=3b5018db546d352a46cae32a64f17a72196a1275 diff --git a/autodlctl b/autodlctl index 6bac751..1b52a58 100755 --- a/autodlctl +++ b/autodlctl @@ -22,7 +22,7 @@ function getnext 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 +37,8 @@ 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 "$estat" -x "curep=$curep") if [ -e "$d/.autodl/wait" ]; then args=("${args[@]}" -w) fi @@ -58,6 +59,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 @@ -74,7 +79,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" @@ -94,8 +99,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