dshjkMerge branch 'master' of ssh://sustancia.synology.me:4545/git/bashscript

This commit is contained in:
2021-01-17 15:23:01 +00:00
7 changed files with 4 additions and 195 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ readonly USAGE="
USAGE:
$(basename "$0") [SYSTEM] [ROM_FOLDER] [THUMBNAILS_FOLDER]"
readonly SYSTEMS="arcade atari2600 atari7800 atarilynx coleco dreamcast fds gamegear gb gba gbc mastersystem megadrive msx n64 nds nes ngp ngpc pcengine psp psx saturn sega32x segacd sg-1000 snes virtualboy wonderswan wonderswancolor"
readonly SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
# check if there are all the parameters
if [ "$#" -ne 3 ]; then
+1 -2
View File
@@ -25,11 +25,10 @@ if ! test -d "${ROM_FOLDER}"/"${SYSTEM}"; then
exit 0
fi
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
readonly ROM_FOLDER="$1"
readonly THUMBNAILS_FOLDER="$2"
readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
readonly SYSTEMS="atari2600 atari7800 atarilynx coleco dreamcast fds gamegear gb gba gbc mastersystem megadrive msx n64 nds nes ngp ngpc pcengine psp psx saturn sega32x segacd sg-1000 snes virtualboy wonderswan wonderswancolor"
readonly SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
for SYSTEM in $SYSTEMS; do
"${SCRIPT_DIR}"/create_retroarch_thumbnails.sh "${SYSTEM}" "${ROM_FOLDER}" "${THUMBNAILS_FOLDER}"
+2 -3
View File
@@ -51,7 +51,6 @@ readonly FRONTEND="$2"
readonly ROM_DIR="$3"
readonly CONSOLE_ART=artwork.xml.retroarch
readonly CONSOLECD_ART=artwork.xml.retroarch
readonly ARCADE_ART=artwork.xml.retroarch
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
@@ -87,7 +86,7 @@ fi
#ALL_SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
## console systems
CONSOLE="atari2600 atari7800 atarilynx coleco dreamcast fds gamegear gb gba gbc mastersystem megadrive msx n64 nds nes ngp ngpc pcengine psp psx saturn sega32x segacd snes virtualboy wonderswan wonderswancolor"
CONSOLE="3do 3ds amiga amstradcpc apple2 arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fds gameandwatch gamegear gb gba gbc gc genesis intellivision mastersystem megacd megadrive msx n64 nds nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
for SYSTEM in $CONSOLE; do
if test -d "${ROM_DIR}"/"${SYSTEM}"; then
if [ "$SCRAP" = true ]; then
@@ -124,7 +123,7 @@ if test -d "${ROM_DIR}"/pcenginecd; then
done
fi
if [ "$BUILD" = true ]; then
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLECD_ART -p pcengine -f "${FRONTEND}" -i "${ROM_DIR}"/pcenginecd
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p pcengine -f "${FRONTEND}" -i "${ROM_DIR}"/pcenginecd
fi
fi
-22
View File
@@ -1,22 +0,0 @@
console="atari2600 atarilynx fds gamegear gb gba gbc mastersystem megadrive msx nes ngp ngpc sega32x snes wonderswan wonderswancolor"
for i in $console; do
Skyscraper --videos --unattend --unpack -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s mobygames
Skyscraper --videos --unattend -p $i -s thegamesdb
Skyscraper --videos --unattend --forcefilename --relative -a artwork.xml.screenshot -p $i
done
consolecd="segacd psx pcengine"
for i in $consolecd; do
Skyscraper --videos --unattend -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s mobygames
Skyscraper --videos --unattend -p $i -s thegamesdb
Skyscraper --videos --unattend --forcefilename --relative -a artwork.xml.cover -p $i
done
arcade="fba neogeo mame-advmame mame-mame4all"
for i in $arcade; do
Skyscraper --videos --unattend -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s arcadedb
Skyscraper --videos --unattend --relative -a artwork.xml.screenshot -p $i
done
-8
View File
@@ -1,8 +0,0 @@
console="atari2600 atarilynx gamegear gb gba gbc mastersystem megadrive nes ngp ngpc pcengine snes"
for i in $console; do
Skyscraper --videos --unattend --unpack -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s mobygames
Skyscraper --videos --unattend -p $i -s thegamesdb
Skyscraper --videos --unattend --forcefilename --relative -a artwork.xml.screenshot -p $i
done
-22
View File
@@ -1,22 +0,0 @@
console="atari2600 atarilynx fds gamegear gb gba gbc mastersystem megadrive msx nes ngp ngpc pcengine sega32x snes wonderswan wonderswancolor"
for i in $console; do
Skyscraper --videos --unattend --unpack -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s mobygames
Skyscraper --videos --unattend -p $i -s thegamesdb
#Skyscraper --videos --unattend --forcefilename --relative -a artwork.xml.screenshot -p $i
done
consolecd="segacd psx"
for i in $consolecd; do
Skyscraper --videos --unattend -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s mobygames
Skyscraper --videos --unattend -p $i -s thegamesdb
#Skyscraper --videos --unattend --forcefilename --relative -a artwork.xml.cover -p $i
done
arcade="fba neogeo mame-advmame mame-mame4all"
for i in $arcade; do
Skyscraper --videos --unattend -p $i -s screenscraper
Skyscraper --videos --unattend -p $i -s arcadedb
#Skyscraper --videos --unattend --relative -a artwork.xml.screenshot -p $i
done
-137
View File
@@ -1,137 +0,0 @@
#!/bin/bash
readonly USAGE="
USAGE:
$(basename "$0") [BUILD or SCRAP] [PATH] [SYSTEM]"
function help_message() {
echo "$USAGE"
echo
echo "Where [SYSTEM] are:"
for WORD in $SYSTEMS; do
echo -e "\t$WORD"
done
}
SYSTEMS="apple2 arcade atari2600 atari7800 atarilynx dreamcast coleco gamegear gb gba gbc mastersystem megadrive msx n64 nds nes ngpc pcengine psp psx saturn sega32x sg-1000 snes vectrex virtualboy wonderswan wonderswancolor"
# check if there are all the parameters
if [ "$#" -ne 3 ]; then
help_message
exit 0
fi
# check if the systems parameter is valid
if ! echo "$SYSTEMS" | grep -w "$3" >/dev/null; then
printf "%s\n" "You must enter a valid SYSTEM name."
help_message
exit 0
fi
# variables
#readonly COLOR_BLACK=$(tput setaf 0)
#readonly COLOR_RED=$(tput setaf 1)
#readonly COLOR_GREEN=$(tput setaf 2)
#readonly COLOR_YELLOW=$(tput setaf 3)
#readonly COLOR_BLUE=$(tput setaf 4)
#readonly COLOR_MAGENTA=$(tput setaf 5)
#readonly COLOR_CYAN=$(tput setaf 6)
readonly COLOR_WHITE=$(tput setaf 7)
#readonly COLOR_BACKGROUND_BLACK=$(tput setab 0)
readonly COLOR_BACKGROUND_RED=$(tput setab 1)
#readonly COLOR_BACKGROUND_GREEN=$(tput setab 2)
#readonly COLOR_BACKGROUND_YELLOW=$(tput setab 3)
#readonly COLOR_BACKGROUND_BLUE=$(tput setab 4)
#readonly COLOR_BACKGROUND_MAGENTA=$(tput setab 5)
#readonly COLOR_BACKGROUND_CYAN=$(tput setab 6)
#readonly COLOR_BACKGROUND_WHITE=$(tput setab 7)
readonly RESET_COLOR=$(tput sgr0)
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
readonly ROM_DIR="$2"
readonly SYSTEM_NAME="$3"
readonly FRONTEND="pegasus"
readonly CONSOLE_ART=artwork.xml.example2
readonly CONSOLECD_ART=artwork.xml.example2
readonly ARCADE_ART=artwork.xml.example2
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
readonly ARCADE_SCRAPERS="screenacraper arcadedb"
readonly CONSOLE="atari2600 atarilynx dreamcast fds gamegear gb gba gbc mastersystem megadrive msx nds nes ngp ngpc pcengine psp saturn sega32x snes wonderswan wonderswancolor"
readonly CONSOLECD="psx segacd"
readonly ARCADE="fba neogeo mame-advmame mame-mame4all"
SCRAP=true
BUILD=true
if [ "$1" = SCRAP ]; then
BUILD=false
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
sleep 1
fi
if [ "$1" = BUILD ]; then
SCRAP=false
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
sleep 1
fi
# console
if echo "${CONSOLE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
if [ "${SCRAP}" = true ]; then
for SCRAPER in ${CONSOLE_SCRAPERS}; do
Skyscraper --flags videos,unattend,noresize,unpack -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
done
fi
if [ "${BUILD}" = true ]; then
Skyscraper --flags videos,unattend,forcefilename,relative,skipexistingvideos -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
#Skyscraper --flags videos,unattend,relative,skipexistingvideos -a $CONSOLE_ART -p $i
fi
exit 0
fi
# consolecd
if echo "${CONSOLECD}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
if [ "${SCRAP}" = true ]; then
for SCRAPER in ${CONSOLE_SCRAPERS}; do
Skyscraper --flags videos,unattend,noresize -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
done
fi
if [ "${BUILD}" = true ]; then
Skyscraper --flags videos,unattend,forcefilename,relative,skipexistingvideos,nobrackets -a $CONSOLECD_ART -p "$SYSTEM_NAME" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
fi
exit 0
fi
# arcade
if echo "${ARCADE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
if [ "${SCRAP}" = true ]; then
for SCRAPER in ${ARCADE_SCRAPERS}; do
Skyscraper --flags videos,unattend,noresize -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
done
fi
if [ "${BUILD}" = true ]; then
Skyscraper --flags videos,unattend,relative,skipexistingvideos,nobrackets -a $ARCADE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
fi
exit 0
fi
# pcenginecd
if [ "$SYSTEM_NAME" = "pcenginecd" ]; then
mv -v "${ROM_DIR}"/pcengine "${ROM_DIR}"/pcengine.cart
mv -v "${ROM_DIR}"/pcenginecd "${ROM_DIR}"/pcengine
if [ "${SCRAP}" = true ]; then
for SCRAPER in $CONSOLE_SCRAPERS; do
Skyscraper --flags videos,unattend,noresize -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
done
fi
if [ "${BUILD}" = true ]; then
Skyscraper --flags videos,unattend,forcefilename,relative,skipexistingvideos,nobrackets -a $CONSOLECD_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
fi
mv -v "${ROM_DIR}"/pcengine "${ROM_DIR}"/pcenginecd
mv -v "${ROM_DIR}"/pcengine.cart "${ROM_DIR}"/pcengine
exit 0
fi