~nova/accendo

d14759f2e28df2fd6ab064b69e4a8c8ff273b324 — Novalinium 2 years ago 1ca32f5
Adjust regex for 2+ digit page counts
1 files changed, 3 insertions(+), 3 deletions(-)

M main.sh
M main.sh => main.sh +3 -3
@@ 12,7 12,7 @@ else
    echo "Failed!"
    exit 1
fi
MAX_PAGE=$(fgrep last_page ${POST_ID}.1.rp | perl -pe 's/.+(\d+)\S+;per_page=\d+\S+Last.*/\1/; print; exit')
MAX_PAGE=$(fgrep last_page ${POST_ID}.1.rp | perl -pe 's/.+\D(\d+)\S+;per_page=\d+\S+Last.*/\1/; print; exit')
if (( MAX_PAGE \> 1 )); then
    seq 2 ${MAX_PAGE} > ${POST_ID}.index
    echo "Done!"


@@ 24,11 24,11 @@ if (( MAX_PAGE \> 1 )); then
        if [ -f ${POST_ID}.${PAGE}.rp ]; then
            echo -n "."
        else
            echo "Failed! ${POST_ID}.${PAGE}.rp not found,"
            echo " Failed! ${POST_ID}.${PAGE}.rp not found,"
            exit 1
        fi
    done
    echo "Done!"
    echo " Done!"
    echo -n "Cleaning index ... ";
    rm ${POST_ID}.index
    echo "Done!"