2023-08-07 02:22:38 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-08-03 15:52:11 +02:00
|
|
|
# This script is for dev purposes
|
2023-08-11 15:24:54 +02:00
|
|
|
scriptVersion="1.1"
|
2023-08-07 02:22:38 +02:00
|
|
|
scriptName="RA-ROM-Downloader"
|
|
|
|
|
|
|
|
#### Import Settings
|
|
|
|
source /config/extended.conf
|
|
|
|
|
|
|
|
|
|
|
|
#### Funcitons
|
2023-08-07 13:10:13 +02:00
|
|
|
log () {
|
|
|
|
m_time=`date "+%F %T"`
|
|
|
|
echo $m_time" :: $scriptName :: $scriptVersion :: "$1 2>&1 | tee -a /config/$scriptName.log
|
|
|
|
}
|
|
|
|
|
|
|
|
logfileSetup () {
|
|
|
|
# auto-clean up log file to reduce space usage
|
|
|
|
if [ -f "/config/$scriptName.log" ]; then
|
|
|
|
if find /config -type f -name "$scriptName.log" -size +1024k | read; then
|
|
|
|
echo "" > /config/$scriptName.log
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "/config/$scriptName.log" ]; then
|
|
|
|
echo "" > /config/$scriptName.log
|
|
|
|
chmod 666 "/config/$scriptName.log"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-08-03 15:52:11 +02:00
|
|
|
UrlDecode () { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
2023-08-07 13:10:13 +02:00
|
|
|
|
2023-08-07 02:22:38 +02:00
|
|
|
CreatePlatformRomList () {
|
|
|
|
if [ -f /config/romlist ]; then
|
|
|
|
rm /config/romlist
|
|
|
|
fi
|
|
|
|
archiveUrl="$(wget -qO- "$1" | grep -io '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//i' -e 's/["'"'"']$//i' | sed 's/\///g' | sort -u | sed "s|^|$1|")"
|
|
|
|
echo "$archiveUrl" | grep -v "\.\." | sort >> /config/romlist
|
2023-08-11 13:35:31 +02:00
|
|
|
sed -i '/#maincontent/d' /config/romlist
|
|
|
|
sed -i '/blog.archive.org/d' /config/romlist
|
2023-08-07 02:22:38 +02:00
|
|
|
}
|
2023-08-07 13:10:13 +02:00
|
|
|
|
2023-08-07 13:41:04 +02:00
|
|
|
DownloadFile () {
|
|
|
|
# $1 = URL
|
|
|
|
# $2 = Output Folder/file
|
|
|
|
# $3 = Number of concurrent connections to use
|
|
|
|
axel -n $3 --output="$2" "$1" | awk -W interactive '$0~/\[/{printf "%s'$'\r''", $0}'
|
|
|
|
#wget -q --show-progress --progress=bar:force 2>&1 "$1" -O "$2"
|
|
|
|
if [ ! -f "$2" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: Download Failed ($1)"
|
2023-08-07 13:41:04 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-08-07 02:22:38 +02:00
|
|
|
DownloadFileVerification () {
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: Verifing Download..."
|
2023-08-07 02:22:38 +02:00
|
|
|
case "$1" in
|
|
|
|
*.zip|*.ZIP)
|
|
|
|
verify="$(unzip -t "$1" &>/dev/null; echo $?)"
|
|
|
|
;;
|
|
|
|
*.rar|*.RAR)
|
|
|
|
verify="$(unrar t "$1" &>/dev/null; echo $?)"
|
|
|
|
;;
|
|
|
|
*.7z|*.7Z)
|
|
|
|
verify="$(7z t "$1" &>/dev/null; echo $?)"
|
|
|
|
;;
|
|
|
|
*.chd|*.CHD)
|
|
|
|
verify="$(chdman verify -i "$1" &>/dev/null; echo $?)"
|
|
|
|
;;
|
|
|
|
*.iso|*.ISO|*.hex|*.HEX|*.wasm|*.WASM|*.sv|*.SV)
|
2023-08-07 13:10:13 +02:00
|
|
|
echo "No methdod to verify this type of file (iso,hex,wasm,sv)"
|
2023-08-07 02:22:38 +02:00
|
|
|
verify="0"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "$verify" != "0" ]; then
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: ERROR :: Failed Verification!"
|
2023-08-07 02:22:38 +02:00
|
|
|
rm "$1"
|
|
|
|
else
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: Download Verified!"
|
2023-08-07 02:22:38 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformSelection () {
|
2023-08-11 15:24:54 +02:00
|
|
|
if [ "$platform" == "snes" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformSnes
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "apple2" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformApple2
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "megadrive" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformMegadrive
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "n64" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformN64
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "megaduck" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformMegaduck
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "pokemini" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformPokemini
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "virtualboy" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformVirtualboy
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "nes" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformNes
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "arduboy" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformArduboy
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "sega32x" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformSega32x
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "mastersystem" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformMastersystem
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "sg1000" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformSg1000
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "atarilynx" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformAtarilynx
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "jaguar" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformJaguar
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "gb" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformGameBoy
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "gbc" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformGameBoyColor
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "gba" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformGameBoyAdvance
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "gamegear" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformGameGear
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "atari2600" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformAtari2600
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "atari7800" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformAtari7800
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "nds" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformNintendoDS
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "colecovision" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformColecoVision
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "intellivision" ]; then
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformIntellivision
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "ngp" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNeoGeoPocket
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "ndsi" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNintendoDSi
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "wasm4" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNintendoWASM-4
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "channelf" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNintendoChannelF
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "o2em" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformO2em
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "arcadia" ]; then
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformArcadia
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "supervision" ]; then
|
2023-08-11 14:53:45 +02:00
|
|
|
PlatformSupervision
|
2023-08-11 15:24:54 +02:00
|
|
|
elif [ "$platform" == "wswan" ]; then
|
|
|
|
PlatformWonderSwan
|
|
|
|
elif [ "$platform" == "vectrex" ]; then
|
|
|
|
PlatformVectrex
|
2023-08-10 21:06:01 +02:00
|
|
|
else
|
|
|
|
log "ERROR :: No Platforms Selected, exiting..."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
DownloadRomCountSummary () {
|
|
|
|
log "Summarizing ROM counts..."
|
|
|
|
romCount=$(find "$romPath" -type f | wc -l)
|
|
|
|
platformCount=$(find "/$romPath" -maxdepth 1 -mindepth 1 -type d | wc -l)
|
|
|
|
log "$romCount ROMS downloaded on $platformCount different platforms!!!"
|
2023-08-10 21:38:31 +02:00
|
|
|
log "Platform breakdown...."
|
2023-08-11 15:24:54 +02:00
|
|
|
echo "Platforms ($platformCount):;Total:;Released:;Hack/Homebrew/Proto/Unlicensed:" > /config/temp
|
2023-08-10 21:06:01 +02:00
|
|
|
for romfolder in $(find "/$romPath" -maxdepth 1 -mindepth 1 -type d); do
|
|
|
|
platform="$(basename "$romfolder")"
|
|
|
|
PlatformSelection
|
2023-08-11 13:35:31 +02:00
|
|
|
platformRomCount=$(find "$romPath/$platformFolder" -type f | wc -l)
|
|
|
|
platformRomSubCount=$(find "$romPath/$platformFolder" -mindepth 2 -type f | wc -l)
|
|
|
|
platformMainRomCount=$(( $platformRomCount - $platformRomSubCount ))
|
2023-08-11 15:24:54 +02:00
|
|
|
echo "$platformName;$platformRomCount;$platformMainRomCount;$platformRomSubCount" >> /config/temp
|
2023-08-10 21:06:01 +02:00
|
|
|
done
|
2023-08-11 13:35:31 +02:00
|
|
|
platformRomSubCount=$(find "$romPath" -mindepth 3 -type f | wc -l)
|
|
|
|
platformMainRomCount=$(( $romCount - $platformRomSubCount ))
|
2023-08-11 15:24:54 +02:00
|
|
|
echo "Totals:;$romCount;$platformMainRomCount;$platformRomSubCount" >> /config/temp
|
|
|
|
data=$(cat /config/temp | column -s";" -t)
|
2023-08-10 21:38:31 +02:00
|
|
|
echo "$data"
|
2023-08-10 21:06:01 +02:00
|
|
|
}
|
2023-08-10 21:38:31 +02:00
|
|
|
|
2023-08-07 02:22:38 +02:00
|
|
|
#### Platforms
|
2023-08-11 15:24:54 +02:00
|
|
|
PlatformVectrex () {
|
|
|
|
platformName="Vectrex"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Vectrex/"
|
|
|
|
platformFolder="vectrex"
|
|
|
|
consoleRomFileExt=".bin, .gam, .vec, .zip, .7z"
|
|
|
|
raConsoleId="46"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-11 14:53:45 +02:00
|
|
|
PlatformSupervision () {
|
2023-08-11 15:24:54 +02:00
|
|
|
platformName="Watara Supervision"
|
2023-08-11 14:53:45 +02:00
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Watara%20Supervision/"
|
|
|
|
platformFolder="supervision"
|
|
|
|
consoleRomFileExt=".sv, .zip, .7z"
|
|
|
|
raConsoleId="63"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformWonderSwan () {
|
|
|
|
platformName="WonderSwan"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/WonderSwan/"
|
|
|
|
platformFolder="wswan"
|
|
|
|
consoleRomFileExt=".ws, .zip, .7z"
|
|
|
|
raConsoleId="53"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformApple2 () {
|
|
|
|
platformName="Apple II"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Apple%20II/"
|
|
|
|
platformFolder="apple2"
|
|
|
|
consoleRomFileExt=".nib, .do, .po, .dsk, .mfi, .dfi, .rti, .edd, .woz, .wav, .zip, .7z"
|
|
|
|
raConsoleId="38"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformArcadia () {
|
|
|
|
platformName="Arcadia 2001"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Arcadia%202001/"
|
|
|
|
platformFolder="arcadia"
|
|
|
|
consoleRomFileExt=".bin, .zip, .7z"
|
|
|
|
raConsoleId="73"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformO2em () {
|
|
|
|
platformName="Magnavox Odyssey 2"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Magnavox%20Odyssey%202/"
|
|
|
|
platformFolder="o2em"
|
|
|
|
consoleRomFileExt=".bin, .zip, .7z"
|
|
|
|
raConsoleId="23"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-07 02:22:38 +02:00
|
|
|
PlatformSnes () {
|
|
|
|
platformName="Super Nintentdo"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_SNES/SNES/"
|
|
|
|
platformFolder="snes"
|
|
|
|
consoleRomFileExt=".smc, .fig, .sfc, .gd3, .gd7, .dx2, .bsx, .swc, .zip, .7z"
|
|
|
|
raConsoleId="3"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-07 13:10:13 +02:00
|
|
|
PlatformMegadrive () {
|
|
|
|
platformName="Mega Drive"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Mega%20Drive/"
|
|
|
|
platformFolder="megadrive"
|
|
|
|
consoleRomFileExt=".bin, .gen, .md, .sg, .smd, .zip, .7z"
|
|
|
|
raConsoleId="1"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-07 13:41:04 +02:00
|
|
|
PlatformN64 () {
|
|
|
|
platformName="Nintendo 64"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Nintendo%2064/"
|
|
|
|
platformFolder="n64"
|
|
|
|
consoleRomFileExt=".z64, .n64, .v64, .zip, .7z"
|
|
|
|
raConsoleId="2"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
2023-08-07 02:22:38 +02:00
|
|
|
|
2023-08-07 15:26:10 +02:00
|
|
|
PlatformMegaduck () {
|
2023-08-07 14:17:24 +02:00
|
|
|
platformName="Mega Duck"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Mega%20Duck/"
|
|
|
|
platformFolder="megaduck"
|
|
|
|
consoleRomFileExt=".bin, .zip, .7z"
|
|
|
|
raConsoleId="69"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-07 15:26:10 +02:00
|
|
|
PlatformPokemini () {
|
|
|
|
platformName="Pokemon Mini"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Pokemon%20Mini/"
|
|
|
|
platformFolder="pokemini"
|
|
|
|
consoleRomFileExt=".min, .zip, .7z"
|
|
|
|
raConsoleId="24"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformVirtualboy () {
|
|
|
|
platformName="Virtual Boy"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Virtual%20Boy/"
|
|
|
|
platformFolder="virtualboy"
|
|
|
|
consoleRomFileExt=".vb, .zip, .7z"
|
|
|
|
raConsoleId="28"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformNes () {
|
|
|
|
platformName="Nintendo Entertainment System"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_NES/NES/"
|
|
|
|
platformFolder="nes"
|
|
|
|
consoleRomFileExt=".nes, .unif, .unf, .zip, .7z"
|
|
|
|
raConsoleId="7"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-07 17:50:09 +02:00
|
|
|
Platform3do () {
|
|
|
|
platformName="3DO Interactive Multiplayer"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/3DO%20Interactive%20Multiplayer/"
|
|
|
|
platformFolder="3do"
|
|
|
|
consoleRomFileExt=".iso, .chd, .cue"
|
|
|
|
raConsoleId="43"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformArduboy () {
|
|
|
|
platformName="Arduboy"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Arduboy/"
|
|
|
|
platformFolder="arduboy"
|
|
|
|
consoleRomFileExt=".hex, .zip, .7z"
|
|
|
|
raConsoleId="71"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformSega32x () {
|
|
|
|
platformName="Sega 32X"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/32X/"
|
|
|
|
platformFolder="sega32x"
|
|
|
|
consoleRomFileExt=".32x, .smd, .bin, .md, .zip, .7z"
|
|
|
|
raConsoleId="10"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformMastersystem () {
|
|
|
|
platformName="Sega Master System"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Master%20System/"
|
|
|
|
platformFolder="mastersystem"
|
|
|
|
consoleRomFileExt=".bin, .sms, .zip, .7z"
|
|
|
|
raConsoleId="11"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformSg1000 () {
|
|
|
|
platformName="SG-1000"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/SG-1000/"
|
|
|
|
platformFolder="sg1000"
|
|
|
|
consoleRomFileExt=".bin, .sg, .zip, .7z"
|
|
|
|
raConsoleId="33"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformAtarilynx () {
|
|
|
|
platformName="Atari Lynx"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Atari%20Lynx/"
|
|
|
|
platformFolder="atarilynx"
|
|
|
|
consoleRomFileExt=".lnx, .zip, .7z"
|
|
|
|
raConsoleId="13"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformJaguar () {
|
|
|
|
platformName="Atari Jaguar"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Atari%20Jaguar/"
|
|
|
|
platformFolder="jaguar"
|
|
|
|
consoleRomFileExt=".cue, .j64, .jag, .cof, .abs, .cdi, .rom, .zip, .7z"
|
|
|
|
raConsoleId="17"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
2023-08-07 15:26:10 +02:00
|
|
|
|
2023-08-08 19:58:07 +02:00
|
|
|
PlatformGameBoy () {
|
|
|
|
platformName="Game Boy"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Game%20Boy/"
|
|
|
|
platformFolder="gb"
|
|
|
|
consoleRomFileExt=".gb, .zip, .7z"
|
|
|
|
raConsoleId="4"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformGameBoyColor () {
|
|
|
|
platformName="Game Boy Color"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Game%20Boy%20Color/"
|
|
|
|
platformFolder="gbc"
|
|
|
|
consoleRomFileExt=".gbc, .zip, .7z"
|
|
|
|
raConsoleId="6"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformGameBoyAdvance () {
|
|
|
|
platformName="Game Boy Advance"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Game%20Boy%20Advance/"
|
|
|
|
platformFolder="gba"
|
|
|
|
consoleRomFileExt=".gba, .zip, .7z"
|
|
|
|
raConsoleId="5"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformGameGear () {
|
|
|
|
platformName="Game Gear"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Game%20Gear/"
|
|
|
|
platformFolder="gamegear"
|
|
|
|
consoleRomFileExt=".bin, .gg, .zip, .7z"
|
|
|
|
raConsoleId="15"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-10 18:22:35 +02:00
|
|
|
PlatformAtari2600 () {
|
|
|
|
platformName="Atari 2600"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Atari%202600/"
|
|
|
|
platformFolder="atari2600"
|
|
|
|
consoleRomFileExt=".a26, .bin, .zip, .7z"
|
|
|
|
raConsoleId="25"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformAtari7800 () {
|
|
|
|
platformName="Atari 7800"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Atari%207800/"
|
|
|
|
platformFolder="atari7800"
|
|
|
|
consoleRomFileExt=".a78, .bin, .zip, .7z"
|
|
|
|
raConsoleId="51"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
2023-08-08 19:58:07 +02:00
|
|
|
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformNintendoDS () {
|
|
|
|
platformName="Nintendo DS"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Nintendo%20DS/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="nds"
|
|
|
|
consoleRomFileExt=".nds, .bin, .zip, .7z"
|
|
|
|
raConsoleId="18"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNintendoDSi () {
|
|
|
|
platformName="Nintendo DSi"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Nintendo%20DSi/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="ndsi"
|
|
|
|
consoleRomFileExt=".nds, .bin, .zip, .7z"
|
|
|
|
raConsoleId="78"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformColecoVision () {
|
|
|
|
platformName="ColecoVision"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/ColecoVision/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="colecovision"
|
|
|
|
consoleRomFileExt=".bin, .col, .rom, .zip, .7z"
|
|
|
|
raConsoleId="44"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformIntellivision () {
|
|
|
|
platformName="Intellivision"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Intellivision/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="intellivision"
|
|
|
|
consoleRomFileExt=".int, .bin, .rom, .zip, .7z"
|
|
|
|
raConsoleId="45"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNeoGeoPocket () {
|
|
|
|
platformName="Neo Geo Pocket"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Neo%20Geo%20Pocket/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="ngp"
|
|
|
|
consoleRomFileExt=".ngp, .zip, .7z"
|
|
|
|
raConsoleId="14"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
2023-08-10 21:06:01 +02:00
|
|
|
|
2023-08-11 13:35:31 +02:00
|
|
|
PlatformNintendoWASM-4 () {
|
|
|
|
platformName="WASM-4"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/WASM-4/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="wasm4"
|
|
|
|
consoleRomFileExt=".wasm"
|
|
|
|
raConsoleId="72"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlatformNintendoChannelF () {
|
|
|
|
platformName="Fairchild Channel F"
|
|
|
|
platformArchiveContentsUrl="https://archive.org/download/retroachievements_collection_v5/Fairchild%20Channel%20F/"
|
|
|
|
downloadExtension="zip"
|
|
|
|
platformFolder="channelf"
|
|
|
|
consoleRomFileExt=".zip, .rom, .bin, .chf"
|
|
|
|
raConsoleId="57"
|
|
|
|
uncompressRom="false"
|
|
|
|
compressRom="false"
|
|
|
|
}
|
2023-08-10 21:06:01 +02:00
|
|
|
|
|
|
|
DownloadRomCountSummary
|
|
|
|
log "######################################"
|
|
|
|
log "Processing platforms..."
|
2023-08-11 15:24:54 +02:00
|
|
|
platform=""
|
2023-08-07 02:22:38 +02:00
|
|
|
platformsToProcessNumber=0
|
|
|
|
IFS=',' read -r -a filters <<< "$platforms"
|
|
|
|
for platform in "${filters[@]}"
|
|
|
|
do
|
|
|
|
platformToProcessNumber=$(( $platformToProcessNumber + 1 ))
|
|
|
|
done
|
|
|
|
|
2023-08-11 15:24:54 +02:00
|
|
|
platform=""
|
2023-08-07 02:22:38 +02:00
|
|
|
processNumber=0
|
|
|
|
IFS=',' read -r -a filters <<< "$platforms"
|
|
|
|
for platform in "${filters[@]}"
|
|
|
|
do
|
|
|
|
processNumber=$(( $processNumber + 1 ))
|
2023-08-10 21:06:01 +02:00
|
|
|
PlatformSelection
|
2023-08-08 19:58:07 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: Starting..."
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: Finding ROMS..."
|
2023-08-07 02:22:38 +02:00
|
|
|
CreatePlatformRomList "$platformArchiveContentsUrl"
|
|
|
|
outputdir="$romPath/$platformFolder"
|
|
|
|
|
|
|
|
romlist=$(cat /config/romlist)
|
|
|
|
romListCount=$(echo "$romlist" | wc -l)
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romListCount ROMS Found!"
|
2023-08-07 02:22:38 +02:00
|
|
|
romProcessNumber=0
|
|
|
|
echo "$romlist" | while read -r rom; do
|
|
|
|
|
|
|
|
romProcessNumber=$(( $romProcessNumber + 1 ))
|
|
|
|
archiveContentsUrl="$rom/"
|
2023-08-10 21:06:01 +02:00
|
|
|
#echo "$rom"
|
2023-08-07 02:22:38 +02:00
|
|
|
archiveUrl="$(wget -qO- "$archiveContentsUrl" | grep -i ".zip" | grep -io '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//i' -e 's/["'"'"']$//i' | sed 's/\///g' | sort -u | sed "s|^|$archiveContentsUrl|")"
|
2023-08-11 13:35:31 +02:00
|
|
|
echo "$archiveUrl" > /config/romfilelist
|
2023-08-07 02:22:38 +02:00
|
|
|
romfiles="$(cat /config/romfilelist | awk '{ print length, $0 }' | sort -n | cut -d" " -f2-)"
|
2023-08-10 21:06:01 +02:00
|
|
|
#echo $romfiles
|
|
|
|
|
2023-08-07 02:22:38 +02:00
|
|
|
# debugging
|
|
|
|
#echo "original list: "
|
|
|
|
#cat romfilelist
|
|
|
|
#echo ""
|
|
|
|
#echo "rom file list sorted by length: "
|
|
|
|
#echo "$romfiles"
|
|
|
|
#filteredUsaRoms="$(echo "$romfiles" | grep "%20%28U%29" | head -n 1)"
|
|
|
|
#echo ""
|
|
|
|
#echo "filtered:"
|
|
|
|
#echo "$filteredUsaRoms"
|
|
|
|
#if [ -f romfilelist ]; then
|
|
|
|
# rm romfilelist
|
|
|
|
#fi
|
|
|
|
#continue\
|
|
|
|
|
|
|
|
filteredUsaRoms="$(echo "$romfiles" | grep -i "%20%28U%29" | head -n 1)"
|
|
|
|
filteredUsaRomscount="$(echo "$romfiles" | grep -i "%20%28U%29" | head -n 1 | wc -l)"
|
|
|
|
filteredUsa2Roms="$(echo "$romfiles" | grep -i "%20%28USA%29" | head -n 1)"
|
|
|
|
filteredUsa2Romscount="$(echo "$romfiles" | grep -i "%20%28USA%29" | head -n 1 | wc -l)"
|
2023-08-07 13:41:04 +02:00
|
|
|
filteredUsa3Roms="$(echo "$romfiles" | grep -i "%20%28UE%29" | head -n 1)"
|
|
|
|
filteredUsa3Romscount="$(echo "$romfiles" | grep -i "%20%28UE%29" | head -n 1 | wc -l)"
|
2023-08-07 14:17:24 +02:00
|
|
|
filteredEuropeRoms="$(echo "$romfiles" | grep -i "%20%28E%29" | head -n 1)"
|
|
|
|
filteredEuropeRomscount="$(echo "$romfiles" | grep -i "%20%28E%29" | head -n 1 | wc -l)"
|
2023-08-10 21:06:01 +02:00
|
|
|
filteredEurope2Roms="$(echo "$romfiles" | grep -i "%20%28Europe%29" | head -n 1)"
|
2023-08-07 14:17:24 +02:00
|
|
|
filteredEurope2Romscount="$(echo "$romfiles" | grep -i "%20%28Europe%29" | head -n 1 | wc -l)"
|
2023-08-07 02:22:38 +02:00
|
|
|
filteredWorldRoms="$(echo "$romfiles" | grep -i "%20%28W%29" | head -n 1)"
|
|
|
|
filteredWorldRomscount="$(echo "$romfiles" | grep -i "%20%28W%29" | head -n 1 | wc -l)"
|
2023-08-07 14:17:24 +02:00
|
|
|
filteredWorld2Roms="$(echo "$romfiles" | grep -i "%20%28World%29" | head -n 1)"
|
|
|
|
filteredWorld2Romscount="$(echo "$romfiles" | grep -i "%20%28World%29" | head -n 1 | wc -l)"
|
2023-08-07 02:22:38 +02:00
|
|
|
filteredJapanRoms="$(echo "$romfiles" | grep -i "%20%28J%29" | head -n 1)"
|
|
|
|
filteredJapanRomscount="$(echo "$romfiles" | grep -i "%20%28J%29" | head -n 1 | wc -l)"
|
2023-08-07 14:17:24 +02:00
|
|
|
filteredJapan2Roms="$(echo "$romfiles" | grep -i "%20%28Japan%29" | head -n 1)"
|
|
|
|
filteredJapan2Romscount="$(echo "$romfiles" | grep -i "%20%28Japan%29" | head -n 1 | wc -l)"
|
2023-08-07 02:22:38 +02:00
|
|
|
filteredOtherRoms="$(echo "$romfiles" | head -n 1)"
|
|
|
|
filteredOtherRomscount="$(echo "$romfiles" | head -n 1 | wc -l)"
|
|
|
|
filteredOtherRomsDecoded="$(UrlDecode "$filteredOtherRoms")"
|
|
|
|
subFolder="$(dirname "$filteredOtherRomsDecoded")"
|
|
|
|
subFolder="$(basename "$subFolder")"
|
2023-08-07 13:10:13 +02:00
|
|
|
romUrl=""
|
2023-08-07 02:22:38 +02:00
|
|
|
if echo "$subFolder" | grep "~" | read; then
|
|
|
|
subFolder="/$(echo "$subFolder" | cut -d "~" -f 2)/"
|
|
|
|
else
|
|
|
|
subFolder="/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "${outputdir}${subFolder}" ]; then
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: Creating \"${subFolder}\" folder... "
|
2023-08-07 02:22:38 +02:00
|
|
|
mkdir -p "${outputdir}${subFolder}"
|
|
|
|
chmod 777 "${outputdir}${subFolder}"
|
|
|
|
fi
|
|
|
|
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: Searching Archive URL ROM Folder"
|
2023-08-07 02:22:38 +02:00
|
|
|
|
|
|
|
if [ $filteredUsaRomscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredUsaRoms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 13:10:13 +02:00
|
|
|
romUrl="$filteredUsaRoms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: USA (U) ROM FOUND ($fileName)"
|
2023-08-07 02:22:38 +02:00
|
|
|
elif [ $filteredUsa2Romscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredUsa2Roms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 13:10:13 +02:00
|
|
|
romUrl="$filteredUsa2Roms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: USA (USA) ROM FOUND ($fileName)"
|
2023-08-07 13:41:04 +02:00
|
|
|
elif [ $filteredUsa3Romscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredUsa3Roms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
|
|
|
romUrl="$filteredUsa3Roms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: USA (USA) ROM FOUND ($fileName)"
|
2023-08-07 14:17:24 +02:00
|
|
|
elif [ $filteredEuropeRomscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredEuropeRoms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
|
|
|
romUrl="$filteredEuropeRoms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: EUROPE ROM FOUND ($fileName)"
|
2023-08-07 14:17:24 +02:00
|
|
|
elif [ $filteredEurope2Romscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredEurope2Roms")"
|
2023-08-07 02:22:38 +02:00
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 14:17:24 +02:00
|
|
|
romUrl="$filteredEurope2Roms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: EUROPE ROM FOUND ($fileName)"
|
2023-08-07 02:22:38 +02:00
|
|
|
elif [ $filteredWorldRomscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredWorldRoms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 14:17:24 +02:00
|
|
|
romUrl="$filteredWorldRoms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: WORLD ROM FOUND ($fileName)"
|
2023-08-07 14:17:24 +02:00
|
|
|
elif [ $filteredWorld2Romscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredWorld2Roms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
|
|
|
romUrl="$filteredWorld2Roms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: WORLD ROM FOUND ($fileName)"
|
2023-08-07 02:22:38 +02:00
|
|
|
elif [ $filteredJapanRomscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredJapanRoms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 14:17:24 +02:00
|
|
|
romUrl="$filteredJapanRoms"
|
2023-08-10 21:06:01 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: JAPAN ROM FOUND ($fileName)"
|
2023-08-07 14:17:24 +02:00
|
|
|
elif [ $filteredJapan2Romscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredJapan2Roms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-10 21:06:01 +02:00
|
|
|
romUrl="$filteredJapan2Roms"
|
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: JAPAN ROM FOUND ($fileName)"
|
2023-08-07 02:22:38 +02:00
|
|
|
elif [ $filteredOtherRomscount -eq 1 ]; then
|
|
|
|
fileName="$(basename "$filteredOtherRoms")"
|
|
|
|
fileName="$(UrlDecode "$fileName")"
|
2023-08-07 13:10:13 +02:00
|
|
|
romUrl="$filteredOtherRoms"
|
2023-08-10 22:10:38 +02:00
|
|
|
if [ ! -z "$fileName" ]; then
|
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: OTHER ROM FOUND ($fileName)"
|
|
|
|
fi
|
2023-08-07 02:22:38 +02:00
|
|
|
fi
|
|
|
|
|
2023-08-10 22:10:38 +02:00
|
|
|
if [ -z "$fileName" ]; then
|
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ERROR :: No Filtered Roms Found ($archiveContentsUrl)..."
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-08-10 21:06:01 +02:00
|
|
|
# verify download
|
|
|
|
if [ -f "${outputdir}${subFolder}${fileName}" ]; then
|
|
|
|
DownloadFileVerification "${outputdir}${subFolder}${fileName}"
|
|
|
|
fi
|
|
|
|
|
2023-08-07 14:17:24 +02:00
|
|
|
# download file
|
2023-08-07 13:10:13 +02:00
|
|
|
if [ ! -f "${outputdir}${subFolder}${fileName}" ]; then
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: ROM downloading to \"${outputdir}${subFolder}\"..."
|
|
|
|
#wget "$romUrl" -O "${outputdir}${subFolder}${fileName}"
|
|
|
|
DownloadFile "$romUrl" "${outputdir}${subFolder}${fileName}" "$concurrentConnectionCount"
|
2023-08-10 21:06:01 +02:00
|
|
|
|
|
|
|
# verify download
|
|
|
|
if [ -f "${outputdir}${subFolder}${fileName}" ]; then
|
|
|
|
DownloadFileVerification "${outputdir}${subFolder}${fileName}"
|
|
|
|
fi
|
2023-08-03 15:52:11 +02:00
|
|
|
else
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: ROM previously downloaded..."
|
2023-08-03 15:52:11 +02:00
|
|
|
fi
|
|
|
|
|
2023-08-07 14:17:24 +02:00
|
|
|
# set permisions
|
|
|
|
if [ -f "${outputdir}${subFolder}${fileName}" ]; then
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $romProcessNumber/$romListCount :: ${fileName} :: Setting Permissions to 666"
|
2023-08-03 15:52:11 +02:00
|
|
|
chmod 666 "${outputdir}${subFolder}${fileName}"
|
|
|
|
fi
|
|
|
|
|
2023-08-07 13:10:13 +02:00
|
|
|
if [ -f /config/romfilelist ]; then
|
|
|
|
rm /config/romfilelist
|
2023-08-03 15:52:11 +02:00
|
|
|
fi
|
2023-08-07 13:10:13 +02:00
|
|
|
done
|
|
|
|
downloadedRomCount=$(find "$outputdir" -type f | wc -l)
|
2023-08-07 13:41:04 +02:00
|
|
|
log "$processNumber/$platformToProcessNumber :: $platformName :: $downloadedRomCount ROMS Successfully Downloaded!!"
|
2023-08-03 15:52:11 +02:00
|
|
|
done
|
|
|
|
|
2023-08-10 21:06:01 +02:00
|
|
|
DownloadRomCountSummary
|
|
|
|
|
2023-08-03 15:52:11 +02:00
|
|
|
exit
|