View Bug Report
DownloadNewData.command deletes HarvestMap*.lua files on curl errors
Bug #: 3748
File: HarvestMap-Data
Date: 08/22/21 03:34 AM
By: nwrcwh5fcs3zcbumjrnyxmi0h
Status: Unconfirmed
DownloadNewData.command script just deletes HarvestMap*.lua files on any curl command errors.
I suggest this change to correct this script.
Now curl command would create ${addondir}/Modules/HarvestMap${zone}/${fn}.new file,
if checks that ${addondir}/Modules/HarvestMap${zone}/${fn}.new file exists and bugger than 100k and if ok renames file to ${addondir}/Modules/HarvestMap${zone}/${fn}

- curl -# -d @"${svfn2}" -o "${addondir}/Modules/HarvestMap${zone}/${fn}" "http://harvestmap.binaryvector.net:8081"
-
+ curl -# -d @"${svfn2}" -o "${addondir}/Modules/HarvestMap${zone}/${fn}.new" "http://harvestmap.binaryvector.net:8081"
+ if [[ $(find "${addondir}/Modules/HarvestMap${zone}/${fn}.new" -type f -size +100000c 2>/dev/null) ]]; then
+ echo "Removing old file..."
+ rm -fv "${addondir}/Modules/HarvestMap${zone}/${fn}"
+ mv -f "${addondir}/Modules/HarvestMap${zone}/${fn}.new" "${addondir}/Modules/HarvestMap${zone}/${fn}"
+ fi
Thank you.

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: nwrcwh5fcs3zcbumjrnyxmi0h - 08/22/21 03:36 AM
ile exists and bigger, not bugger lol