page on nsfw and upload limit to 20 pages at a time

This commit is contained in:
/dev/urandom 2021-05-26 18:55:35 +03:00
parent c67f2f4365
commit 6467d3b671

View file

@ -91,7 +91,12 @@ fi
if [[ ${#UPARGS[@]} -gt 0 ]]; then if [[ ${#UPARGS[@]} -gt 0 ]]; then
if [[ ! ${NOUPLOAD} ]]; then if [[ ! ${NOUPLOAD} ]]; then
curl ${UPARGS[@]} "https://$N_USER:$N_PWD@neocities.org/api/upload" && touch upload.lasttime # Upload 20 files at a time to avoid cURL crashes
STARTINDEX=0
while [ $STARTINDEX -lt ${#UPARGS[@]} ]; do
curl ${UPARGS[@]:$STARTINDEX:20} "https://$N_USER:$N_PWD@neocities.org/api/upload" && touch upload.lasttime
STARTINDEX=$(($STARTINDEX+20))
done
else else
echo "Not uploading differing files." echo "Not uploading differing files."
fi fi