#!/bin/bash # Prerequisites: jc, jq & rsync cd path/to/fixDat_blahblah.dat || exit mv fixDat_*.dat fixDat.dat # RomVault has a cutoff description bug in fixDATs #jc --xml < fixDat.dat | jq '.datafile.game[] | .description | . + ".zip"' | sed 's/"//g' > fixDat.txt # So use @name instead, but this could be wrong if you use local names in Retool jc --xml < fixDat.dat | jq '.datafile.game[] | .["@name"] | . + ".zip"' | sed 's/"//g' > fixDat.txt cp fixDat.txt path/to/RetroArch/fixDat.txt ROMSET=$(jc --xml < fixDat.dat | jq '.datafile.header.description | sub("FixDat_"; "")' | sed 's/"//g') cd path/to/RetroArch || exit rsync -avP --ignore-existing --append --update --max-size="200m" --include-from="fixDat.txt" --exclude="*" "rsync://rsync.example.com/files/No-Intro/${ROMSET}/" "roms/No-Intro/${ROMSET}/" rm fixDat.txt