Attached the patch. I moved above common snippet to scripts-url as a function curlUrl. I did some minor fix (typo in help massage, remove shell var that never used). Worked well on my Mac.
BTW, I realized that readercycle script is almost same as commit and it is somewhat old? Because the check code of commit request is:
# check status of commit request
echo $rs | grep '<response.*status="0"' > /dev/null 2>&1
but in commit script, the check code is:
# check status of commit request - original format
echo $rs | grep '<result.*status="0"' > /dev/null 2>&1
readercycle sees "<response status="0">" while commit sees "<result status="0">"... And commit script then check "new format xml" but readercycle never check "new format". So, readercycle always fails (I made fix it in the patch).
Can we delete readercycle? Or am I missing something?