meclean 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # Runs me_cleaner on multiple ROM images .as many as you want!
  4. # Filename of modded image will be filename.neutered. so, .neutered added
  5. # to the end of the filename
  6. #
  7. # Copyright (C) 2020 Leah Rowe <info@minifree.org>
  8. #
  9. # This program is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. [ "x${DEBUG+set}" = 'xset' ] && set -v
  23. set -u -e
  24. if [ ! -f "me_cleaner/me_cleaner.py" ]; then
  25. printf "\nme_cleaner not found. Please run: ./download me_cleaner\n"
  26. exit 1
  27. fi
  28. if [ $# -gt 0 ]; then
  29. for rom in "${@}"; do
  30. if [ ! -f "${rom}" ]; then
  31. printf "\nWARNING: meclean script: file %s does not exist. skipping\n" "${rom}"
  32. continue
  33. fi
  34. [ ! -d "bin/neutered/" ] && mkdir -p "bin/neutered/"
  35. [ -f "bin/neutered/${rom##*/}" ] && \
  36. rm -f "bin/neutered/${rom##*/}.neutered"
  37. python3 me_cleaner/me_cleaner.py -S -t -r -O "bin/neutered/${rom##*/}.neutered" "${rom}" \
  38. || continue
  39. printf "\nOriginal ROM:\n%s\nNeutered ROM available at: %s\n" \
  40. "${rom}" "bin/neutered/${rom##*/}.neutered"
  41. done
  42. else
  43. printf "\nERROR: meclean script: no argument given. Please specify a ROM path\n"
  44. exit 1
  45. fi
  46. printf "\nYour ME-neutered ROMs are under bin/neutered/\n"