Updated ipfs gateway, improved validation of zip files.

This commit is contained in:
Storm Dragon 2024-12-13 22:52:37 -05:00
parent 60dea14aee
commit 232c6b4dd9

View File

@ -205,16 +205,17 @@ download() {
fi
# Skip if the item is in cache.
test -e "${cache}/${dest}" && continue
if ! curl -L4 --output "${cache}/${dest}" "${i}" ; then
{ if ! curl -L4 --output "${cache}/${dest}" "${i}" ; then
echo "Could not download \"$i\"..."
exit 1
fi
fi; } | dialog --backtitle "Linux Game Manager" \
--progressbox "Downloading \"$dest\" from \"$i\"" -1 -1
local downloadError=1
case "${dest##*.}" in
"pk3"|"zip")
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/zip" ]]; then
downloadError=0
fi
unzip -tq "${cache}/${dest}" | dialog --backtitle "Linux Game Manager" \
--progressbox "Validating ${dest##*.} file" -1 -1 --stdout
downloadError= $?
;;
"wad")
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/octet-stream" ]]; then
@ -297,7 +298,7 @@ help() {
echo "The syntax is variable=\"value\""
echo
echo "doomLanguage=\"en\" # 2 letter language code for translation."
echo "ipfsGateway=\"https://gateway.pinata.cloud\" # Gateway to be used for ipfs downloads."
echo "ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads."
echo "noCache=\"true\" # Do not keep downloaded items in the cache."
echo "spd_module=\<module_name>\" # set speech-dispatcher module."
echo "spd_pitch=\<number>\" # set speech-dispatcher speech pitch."
@ -511,7 +512,7 @@ if [[ -r "${configFile%/*}/settings.conf" ]]; then
fi
unset noCache
export doomLanguage="${doomLanguage:-en}"
export ipfsGateway="${ipfsGateway:-https://gateway.pinata.cloud}"
export ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}"
export spd_module="${spd_module:+ -o ${spd_module}}"
export spd_pitch="${spd_pitch:+ -p ${spd_pitch}}"
export spd_rate="${spd_rate:+ -r ${spd_rate}}"