Reubicados los archivos en carpetas
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script para ejecutar un slideshow con eom
|
||||
# de una carpeta al azar dentro de un directorio
|
||||
if [[ $1 == 1 ]]
|
||||
then
|
||||
FOLDER=/home/sergio/zx/scr_packs
|
||||
SUBFOLDERS=("${FOLDER}"/*/)
|
||||
NUM=$(( RANDOM % ${#SUBFOLDERS[@]}))
|
||||
#eom -f -s "${SUBFOLDERS[$NUM]}"
|
||||
feh "${SUBFOLDERS[$NUM]}" -z -D 60 -F -Y
|
||||
fi
|
||||
|
||||
|
||||
# Script para montar un tunel ssh hasta una camara
|
||||
# y mostrar el stream de video con el vlc
|
||||
if [[ $1 == 2 ]]
|
||||
then
|
||||
sleep 20
|
||||
ssh -f -o ExitOnForwardFailure=yes cam sleep 30
|
||||
vlc -f rtsp://admin:ImouCr1st1n4@127.0.0.1:3501
|
||||
fi
|
||||
|
||||
|
||||
# Script para mostrar un video al azar de una carpeta
|
||||
# en modo pantalla completa y en bucle
|
||||
if [[ $1 == 3 ]]
|
||||
then
|
||||
FOLDER=/home/sergio/Vídeos/zx_spectrum
|
||||
VIDEOS=("${FOLDER}"/*)
|
||||
NUM=$(( RANDOM % ${#VIDEOS[@]}))
|
||||
ls -d $FOLDER > /tmp/auto_raspi.m3u
|
||||
#vlc "${VIDEOS[$NUM]}" --fullscreen --loop --no-osd --mouse-hide-timeout=1 --no-mouse-events
|
||||
vlc /tmp/auto_raspi.m3u --random --fullscreen --loop --no-osd --mouse-hide-timeout=1 --no-mouse-events
|
||||
fi
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Variables
|
||||
NOW=$(date +"%d-%m-%Y %T")
|
||||
readonly NOW
|
||||
|
||||
# IP o nombre del servidor
|
||||
readonly SERVER=maverick
|
||||
|
||||
## Destino del backup
|
||||
readonly BACKUP_MOUNT=/sustancia/backup
|
||||
readonly BACKUP_TARGET=${BACKUP_MOUNT}/macbook_air
|
||||
readonly TARGET_FILES=${BACKUP_TARGET}/files
|
||||
readonly TARGET_HOME=${BACKUP_TARGET}/home
|
||||
|
||||
## Backup de la carpeta home
|
||||
readonly BACKUP_HOME=/Users/sergio
|
||||
|
||||
## Empieza el proceso de backup
|
||||
printf "\n\nCOMIENZA LA COPIA DE SEGURIDAD (%s)\n" "${NOW}"
|
||||
|
||||
## Backup de ficheros
|
||||
FILES=".gitconfig .git-credentials"
|
||||
for FILE in $FILES; do
|
||||
printf "\n\n>> COPIANDO FICHEROS\n"
|
||||
if [ -f "${BACKUP_HOME}"/"${FILE}" ]; then
|
||||
rsync -avhP --delete --rsync-path="mkdir -p "${TARGET_FILES}/" && rsync" "${BACKUP_HOME}"/"${FILE}" "${SERVER}":"${TARGET_FILES}/"
|
||||
fi
|
||||
done
|
||||
|
||||
## Backup de las carpetas del directorio home
|
||||
FOLDERS=".ssh Documents Downloads Pictures"
|
||||
for FOLDER in $FOLDERS; do
|
||||
if [ -d "${BACKUP_HOME}"/"${FOLDER}" ]; then
|
||||
printf "\n\n>> COPIANDO %s\n" "${FOLDER}"
|
||||
rsync -avhP --delete --rsync-path="mkdir -p "${TARGET_HOME}/" && rsync" "${BACKUP_HOME}"/"${FOLDER}" "${SERVER}":"${TARGET_HOME}"
|
||||
fi
|
||||
done
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Variables
|
||||
NOW=$(date +"%d-%m-%Y %T")
|
||||
readonly NOW
|
||||
|
||||
## Destino del backup
|
||||
readonly BACKUP_MOUNT=/sustancia/backup
|
||||
readonly BACKUP_TARGET=${BACKUP_MOUNT}/maverick
|
||||
readonly LOG="${BACKUP_TARGET}"/backup_maverick.log
|
||||
readonly TARGET_SYSTEM_FILES=${BACKUP_TARGET}/system
|
||||
readonly TARGET_FILES=${BACKUP_TARGET}/files
|
||||
readonly TARGET_DOCKER=${BACKUP_TARGET}/docker
|
||||
readonly TARGET_HOME=${BACKUP_TARGET}/home
|
||||
|
||||
## Backup de la carpeta home
|
||||
readonly BACKUP_HOME=/home/sergio
|
||||
|
||||
## Backup de docker
|
||||
readonly BACKUP_DOCKER=/home/sergio/docker
|
||||
readonly BACKUP_DOCKER_VOLUMES=/var/volumes
|
||||
|
||||
## Monta la carpetas del nas
|
||||
mount $BACKUP_MOUNT
|
||||
|
||||
## Comprueba si se ha montado la carpeta
|
||||
if [ -f ${BACKUP_MOUNT}/not_mount ]; then
|
||||
printf "No se ha montado la carpeta de destino\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## Empieza el proceso de backup
|
||||
printf "\n\nCOMIENZA LA COPIA DE SEGURIDAD (%s)\n" "${NOW}" | tee -a "${LOG}"
|
||||
|
||||
## Backup de ficheros del sistema
|
||||
printf "\n\n>> COPIANDO FICHEROS DEL SISTEMA\n" | tee -a "${LOG}"
|
||||
mkdir -p "${TARGET_SYSTEM_FILES}/"
|
||||
for i in /etc/cron.*; do
|
||||
rsync -avh --delete "$i" "${TARGET_SYSTEM_FILES}"/ | tee -a "${LOG}"
|
||||
done
|
||||
rsync -avh --delete /etc/fstab "${TARGET_SYSTEM_FILES}"/ | tee -a "${LOG}"
|
||||
|
||||
## Backup de ficheros
|
||||
FILES=".gitconfig .git-credentials"
|
||||
for FILE in $FILES; do
|
||||
printf "\n\n>> COPIANDO FICHEROS\n" | tee -a "${LOG}"
|
||||
if [ -f "${BACKUP_HOME}"/"${FILE}" ]; then
|
||||
mkdir -p "${TARGET_FILES}/"
|
||||
rsync -avh --delete "${BACKUP_HOME}"/"${FILE}" "${TARGET_FILES}/" | tee -a "${LOG}"
|
||||
fi
|
||||
done
|
||||
|
||||
## Backup de las carpetas del directorio home
|
||||
FOLDERS=".ssh"
|
||||
for FOLDER in $FOLDERS; do
|
||||
if [ -d "${BACKUP_HOME}"/"${FOLDER}" ]; then
|
||||
printf "\n\n>> COPIANDO %s\n" "${FOLDER}" | tee -a "${LOG}"
|
||||
mkdir -p "${TARGET_HOME}"
|
||||
rsync -avh --delete "${BACKUP_HOME}"/"${FOLDER}" "${TARGET_HOME}" | tee -a "${LOG}"
|
||||
fi
|
||||
done
|
||||
|
||||
## Backup de docker compose y volumenes
|
||||
printf "\n\n>> DETENIENDO CONTENEDORES\n"
|
||||
docker stop $(docker ps -q) | tee -a "${LOG}"
|
||||
|
||||
FOLDER=DOCKER
|
||||
if [ -d "${BACKUP_DOCKER}" ]; then
|
||||
printf "\n\n>> COPIANDO %s\n" "${FOLDER}" | tee -a "${LOG}"
|
||||
mkdir -p "${TARGET_DOCKER}/compose/"
|
||||
rsync -avh --delete "${BACKUP_DOCKER}/" "${TARGET_DOCKER}/compose/" | tee -a "${LOG}"
|
||||
fi
|
||||
FOLDER=DOCKER_VOLUMES
|
||||
if [ -d "${BACKUP_DOCKER_VOLUMES}" ]; then
|
||||
printf "\n\n>> COPIANDO %s\n" "${FOLDER}" | tee -a "${LOG}"
|
||||
mkdir -p "${TARGET_DOCKER}/volumes/"
|
||||
rsync -avh --delete "${BACKUP_DOCKER_VOLUMES}/" "${TARGET_DOCKER}/volumes/" | tee -a "${LOG}"
|
||||
fi
|
||||
|
||||
printf "\n\n>> ARRANCANDO CONTENEDORES\n"
|
||||
docker start $(docker ps -a -q) | tee -a "${LOG}"
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASEDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit ; pwd -P )"
|
||||
readonly BASEDIR
|
||||
readonly SOURCE=~/roms/filtered
|
||||
C_BLUE=$(tput setaf 4)
|
||||
readonly C_BLUE
|
||||
C_NORMAL=$(tput sgr0)
|
||||
readonly C_NORMAL
|
||||
|
||||
## Elimina los directorios
|
||||
printf "%s\n" "${C_BLUE}elimina los directorios ...${C_NORMAL}"
|
||||
rm "${BASEDIR}"/bios
|
||||
rm -rdf "${BASEDIR}"/images
|
||||
rm -rdf "${BASEDIR}"/videos
|
||||
rm -rdf "${BASEDIR}"/roms
|
||||
|
||||
## Crea los directorios
|
||||
printf "%s\n" "${C_BLUE}crea los directorios ...${C_NORMAL}"
|
||||
ln -sv ~/roms/bios/retroarch "${BASEDIR}"/bios
|
||||
mkdir -pv "${BASEDIR}"/roms/arcade/lr-fbneo
|
||||
mkdir -pv "${BASEDIR}"/images
|
||||
mkdir -pv "${BASEDIR}"/videos
|
||||
|
||||
## Añade los enlaces a las roms
|
||||
printf "\n%s\n" "${C_BLUE}añade los enlaces a las roms de consola ...${C_NORMAL}"
|
||||
~/roms/packs/create_rom_pack.sh ${SOURCE} "${BASEDIR}"/roms console
|
||||
|
||||
printf "\n%s\n" "${C_BLUE}añade los enlaces a los juegos de cd ...${C_NORMAL}"
|
||||
~/roms/packs/create_rom_pack.sh ${SOURCE} "${BASEDIR}"/roms cd_system
|
||||
|
||||
## Elimina los sistemas que sobran
|
||||
printf "\n%s\n" "${C_BLUE}elimina las carpetas que sobran ...${C_NORMAL}"
|
||||
rm -rdfv "${BASEDIR}"/roms/dreamcast
|
||||
rm -rdfv "${BASEDIR}"/roms/psp
|
||||
rm -rdfv "${BASEDIR}"/roms/saturn
|
||||
|
||||
## Copia las roms de arcade
|
||||
printf "\n%s\n" "${C_BLUE}añade las roms de cps1 ...${C_NORMAL}"
|
||||
cp -v ${SOURCE}/cps1/*.zip "${BASEDIR}"/roms/arcade/lr-fbneo
|
||||
|
||||
printf "\n%s\n" "${C_BLUE}añade las roms de cps2 ...${C_NORMAL}"
|
||||
cp -v ${SOURCE}/cps2/*.zip "${BASEDIR}"/roms/arcade/lr-fbneo
|
||||
|
||||
## Escanea las roms para añadir las imagenes y videos
|
||||
printf "\n%s\n" "${C_BLUE}escanea las roms para añadir imagenes y videos ...${C_NORMAL}"
|
||||
~/code/bashscript/skyscraper.sh build emulationstation "${BASEDIR}"/roms
|
||||
|
||||
## Mueve las imagenes y los videos a sus respectivas carpetas
|
||||
printf "\n%s\n" "${C_BLUE}mueve las imagenes y los videos a sus respectivas carpetas ...${C_NORMAL}"
|
||||
for SYSTEM in $(find ./roms -maxdepth 1 -mindepth 1 -type d -exec basename {} \;); do
|
||||
printf "%s\n" "procesando las imagenes y videos de ${C_BLUE}${SYSTEM}${C_NORMAL} ..."
|
||||
if [ -d "${BASEDIR}"/roms/"${SYSTEM}"/media/ ]
|
||||
then
|
||||
mv "${BASEDIR}"/roms/"${SYSTEM}"/media/screenshots "${BASEDIR}"/images/"${SYSTEM}"
|
||||
mv "${BASEDIR}"/roms/"${SYSTEM}"/media/videos "${BASEDIR}"/videos/"${SYSTEM}"
|
||||
rm -rdf "${BASEDIR}"/roms/"${SYSTEM}"/media
|
||||
fi
|
||||
done
|
||||
if [ -d "${BASEDIR}"/images/arcade ]
|
||||
then
|
||||
mkdir -p "${BASEDIR}"/images/arcade/lr-fbneo
|
||||
mv "${BASEDIR}"/images/arcade/*.png "${BASEDIR}"/images/arcade/lr-fbneo
|
||||
fi
|
||||
|
||||
## Elimina los ficheros gamelist.xml
|
||||
printf "\n%s\n" "${C_BLUE}elimina los ficheros gamelist.xml ...${C_NORMAL}"
|
||||
find "${BASEDIR}" -type f -iname "gamelist.xml" -exec rm -v {} \;
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Place this script into root folder that contains .7z archives
|
||||
## May need to chmod +x file to make executable
|
||||
|
||||
## Uncomment below if required software not on system
|
||||
#sudo apt-get install -y mame-tools p7zip-full
|
||||
|
||||
## Extract 7z
|
||||
for x7zFile in *.7z; do
|
||||
gameName="$(basename "$x7zFile" .7z)"
|
||||
printf "\n>> Extracting %s\n" "${gameName}"
|
||||
7z x "${x7zFile}" -o./"${gameName}-tmp"
|
||||
|
||||
## Convet to chd
|
||||
printf "\n>> Converting %s\n" "${gameName}"
|
||||
if [ -f "./${gameName}-tmp/${gameName}.cue" ]; then
|
||||
chdman createcd -i "./${gameName}-tmp/${gameName}.cue" -o ./"${gameName}.chd"
|
||||
else
|
||||
if [ -f "./${gameName}-tmp/${gameName}.iso" ]; then
|
||||
chdman createcd -i "./${gameName}-tmp/${gameName}.iso" -o ./"${gameName}.chd"
|
||||
fi
|
||||
fi
|
||||
|
||||
## Delete temporary directory
|
||||
rm -R ./"${gameName}-tmp"
|
||||
|
||||
## Delete original 7z archive
|
||||
if [ -f ./"${gameName}.chd" ]; then
|
||||
rm ./"$x7zFile"
|
||||
printf "\n>> %s complete\n" "${gameName}"
|
||||
else
|
||||
printf "\n>> %s failed\n" "${gameName}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
printf "\nAll done."
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
###uncomment below if required software not on system
|
||||
#sudo apt-get install -y mame-tools p7zip-full
|
||||
|
||||
readonly cue="$1"
|
||||
readonly destdir="$2"
|
||||
|
||||
# procesa el fitxer
|
||||
|
||||
readonly gameName="$(basename "$cue" .cue)"
|
||||
|
||||
if [ -f "${destdir}/${gameName}.chd" ]; then
|
||||
echo -e "\e[1m\e[41m${gameName}.chd already exists\033[0m"
|
||||
else
|
||||
echo -e "\e[1m\e[41mProcessing ${gameName}...\033[0m"
|
||||
chdman createcd -i "${cue}" -o "${destdir}/${gameName}.chd"
|
||||
fi
|
||||
|
||||
echo "!!!!!!!!!!${gameName} complete..."
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Instala los programas necesarios
|
||||
#sudo apt-get install -y mame-tools p7zip-full
|
||||
|
||||
## Comprueba los parametros
|
||||
if [ "$#" -lt 2 ]; then
|
||||
printf "Uso: chd_from_zip.sh SOURCEDIR DESTDIR [-remove]\n"
|
||||
exit 0
|
||||
else
|
||||
readonly sourcedir="$1"
|
||||
readonly destdir="$2"
|
||||
fi
|
||||
|
||||
# Comprueba que exista el directorio de origen
|
||||
if [ ! -d "$1" ]; then
|
||||
printf "El directorio %s no existe\n" "$1"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Colores
|
||||
WHITE=$(tput setaf 7)
|
||||
RED_BG=$(tput setab 1)
|
||||
BLUE_BG=$(tput setab 4)
|
||||
NORMAL=$(tput sgr0)
|
||||
BOLD=$(tput bold)
|
||||
|
||||
# Procesa los ficheros
|
||||
for zipfile in "${sourcedir}"/*.zip; do
|
||||
gameName="$(basename "$zipfile" .zip)"
|
||||
|
||||
# Comprueba si existe ya el fichero antes de extraerlo
|
||||
if [ -f "${destdir}/${gameName}.chd" ]; then
|
||||
TEXT=">> ${gameName}.chd already exists"
|
||||
printf "%s\n" "${BOLD}${WHITE}${RED_BG}${TEXT}${NORMAL}"
|
||||
else
|
||||
TEXT=">> Extracting ${gameName}..."
|
||||
printf "\n%s\n" "${BOLD}${WHITE}${RED_BG}${TEXT}${NORMAL}"
|
||||
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
|
||||
|
||||
# Convierte a CHD
|
||||
TEXT=">> Converting ${gameName}..."
|
||||
printf "\n%s\n" "${BOLD}${WHITE}${RED_BG}${TEXT}${NORMAL}"
|
||||
find "${destdir}/${gameName}-tmp/" -type f -iname "*.cue" -exec chdman createcd -i {} -o "${destdir}/${gameName}.chd" \;
|
||||
|
||||
# Borra el directorio temporal
|
||||
rm -rdf "${destdir}/${gameName}-tmp"
|
||||
fi
|
||||
|
||||
# Elimina el fichero
|
||||
if [ "$3" = "-remove" ]; then
|
||||
rm "$zipfile"
|
||||
fi
|
||||
|
||||
TEXT=">> ${gameName} completed !!!"
|
||||
printf "\n%s\n" "${BOLD}${WHITE}${BLUE_BG}${TEXT}${NORMAL}"
|
||||
|
||||
done
|
||||
|
||||
printf "All done.\n"
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Texto
|
||||
#BLACK=$(tput setaf 0)
|
||||
#RED=$(tput setaf 1)
|
||||
#GREEN=$(tput setaf 2)
|
||||
#YELLOW=$(tput setaf 3)
|
||||
#LIME_YELLOW=$(tput setaf 190)
|
||||
#POWDER_BLUE=$(tput setaf 153)
|
||||
BLUE=$(tput setaf 4)
|
||||
#MAGENTA=$(tput setaf 5)
|
||||
#CYAN=$(tput setaf 6)
|
||||
WHITE=$(tput setaf 7)
|
||||
|
||||
# Fondo
|
||||
#BLACK_BG=$(tput setab 0)
|
||||
RED_BG=$(tput setab 1)
|
||||
#GREEN_BG=$(tput setab 2)
|
||||
#YELLOW_BG=$(tput setab 3)
|
||||
#LIME_YELLOW_BG=$(tput setab 190)
|
||||
#POWDER_BLUE_BG=$(tput setab 153)
|
||||
#BLUE_BG=$(tput setab 4)
|
||||
#MAGENTA_BG=$(tput setab 5)
|
||||
#CYAN_BG=$(tput setab 6)
|
||||
#WHITE_BG=$(tput setab 7)
|
||||
|
||||
# Especiales
|
||||
#BRIGHT=$(tput bold)
|
||||
NORMAL=$(tput sgr0)
|
||||
#BLINK=$(tput blink)
|
||||
#REVERSE=$(tput smso)
|
||||
#UNDERLINE=$(tput smul)
|
||||
BOLD=$(tput bold)
|
||||
|
||||
printf "%40s\n" "${BLUE}This text is blue${NORMAL}"
|
||||
|
||||
gameName=Sonic
|
||||
TEXT=">> ${gameName}.chd already exists"
|
||||
printf "%s\n" "${BOLD}${WHITE}${RED_BG}${TEXT}${NORMAL}"
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
file="/home/sergio/jailers/list2.txt"
|
||||
|
||||
src="/home/sergio/jailers/"
|
||||
dst="/home/sergio/pas/"
|
||||
|
||||
rm -rdf $dst
|
||||
mkdir -p $dst
|
||||
|
||||
i=1
|
||||
while read -r line; do
|
||||
|
||||
#Reading each line
|
||||
echo "Line No. $i : $line"
|
||||
mkdir -p "$dst$line"
|
||||
cp -vpr "$src$line"/* "$dst$line"
|
||||
i=$((i+1))
|
||||
|
||||
printf "\n"
|
||||
done < $file
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
# Script para copiar ciertas carpetas de Skrapper
|
||||
|
||||
## Comprueba los parametros
|
||||
if [ "$#" -lt 2 ]; then
|
||||
printf "Uso: %s SOURCEDIR DESTDIR\n" "$(basename "$0")"
|
||||
exit 0
|
||||
else
|
||||
readonly ORIGEN="$1"
|
||||
readonly DESTINO="$2"
|
||||
fi
|
||||
|
||||
# Comprueba que exista el directorio de origen
|
||||
if [ ! -d "$1" ]; then
|
||||
printf "El directorio %s no existe\n" "$1"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Si no existe, crea el directorio de destino
|
||||
if [ ! -d "$2" ]; then
|
||||
mkdir -p "$2"
|
||||
fi
|
||||
|
||||
# Colores
|
||||
WHITE=$(tput setaf 7)
|
||||
BLUE_BG=$(tput setab 4)
|
||||
LIME_YELLOW=$(tput setaf 190)
|
||||
NORMAL=$(tput sgr0)
|
||||
BOLD=$(tput bold)
|
||||
|
||||
MEDIA="cover title screenshot"
|
||||
readonly MEDIA
|
||||
|
||||
# Crea la carpeta de destino
|
||||
mkdir -p "${DESTINO}"
|
||||
|
||||
# Procesa todas las carpetas
|
||||
for ITEM in "${ORIGEN}"/*; do
|
||||
# Obten el nombre del sistema y lo imprime en pantalla
|
||||
SISTEMA=$(basename "${ITEM}")
|
||||
printf "\n\n%s\n" "${BOLD}${WHITE}${BLUE_BG} ${SISTEMA} ${NORMAL}"
|
||||
# Procesa la lista de carpetas
|
||||
for CARPETA in $MEDIA; do
|
||||
printf "\n%s\n" "${BOLD}${LIME_YELLOW}${CARPETA}${NORMAL}"
|
||||
# Crea el directorio de destino donde copiarlo todo
|
||||
mkdir -p "${DESTINO}/${SISTEMA}/${CARPETA}"
|
||||
# Copia las imagenes
|
||||
rsync -avh --delete --chmod=755 "${ITEM}"/"${CARPETA}/" "${DESTINO}/${SISTEMA}/${CARPETA}/"
|
||||
# Copia el gamelist.xml
|
||||
rsync -avh --delete --chmod=755 "${ITEM}"/gamelist.xml "${DESTINO}/${SISTEMA}/"
|
||||
# Calcula el numero de subcarpetas
|
||||
NUM_SUBCARPETAS=$(find "${DESTINO}/${SISTEMA}/${CARPETA}" -mindepth 1 -type d | wc -l)
|
||||
# Si existen subcarpetas
|
||||
if [ "$NUM_SUBCARPETAS" != 0 ]; then
|
||||
# Busca todos los ficheros en la carpeta y subcarpeta y los mueve a la raíz
|
||||
find "${DESTINO}/${SISTEMA}/${CARPETA}" -type f -exec mv {} "${DESTINO}/${SISTEMA}/${CARPETA}" \;
|
||||
# Borra las subcarpetas
|
||||
find "${DESTINO}/${SISTEMA}/${CARPETA}" -mindepth 1 -type d -exec rm -rdf {} \;
|
||||
fi
|
||||
# Cambia el propietario de los archivos
|
||||
chown sergio:sergio "${DESTINO}/${SISTEMA}/${CARPETA}/"*
|
||||
done
|
||||
done
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
readonly SYSTEMS="arcade atari2600 atarilynx fds gamegear gb gba gbc mastersystem megadrive msx msx2 neogeo nes ngp ngpc pcengine pcenginecd psx sega32x segacd snes wonderswan wonderswancolor"
|
||||
readonly DIR=~/roms/cheevos_and_no_cheevos/
|
||||
|
||||
for SYSTEM in $SYSTEMS; do
|
||||
mkdir -p "${DIR}"/"${SYSTEM}"
|
||||
|
||||
if test -d ~/roms/retroachievements.2020/"${SYSTEM}"; then
|
||||
ln -s ~/roms/retroachievements.2020/"${SYSTEM}" "${DIR}"/"${SYSTEM}"/cheevos
|
||||
fi
|
||||
|
||||
if test -d ~/roms/rgbpi/"${SYSTEM}"; then
|
||||
ln -s ~/roms/rgbpi/"${SYSTEM}" "${DIR}"/"${SYSTEM}"/no_cheevos
|
||||
fi
|
||||
done
|
||||
Executable
+124
@@ -0,0 +1,124 @@
|
||||
#!/bin/bash
|
||||
|
||||
## usage
|
||||
USAGE="USAGE:
|
||||
$(basename "$0") source dest system"
|
||||
|
||||
function help_message() {
|
||||
printf "%s\n" "$USAGE"
|
||||
printf "%s" "Where system are: "
|
||||
for WORD in $SYSTEM_LIST; do
|
||||
printf "%s " "$WORD"
|
||||
done
|
||||
printf "\n"
|
||||
}
|
||||
readonly USAGE
|
||||
|
||||
readonly SYSTEM_LIST="console handheld computer cd_system arcade"
|
||||
|
||||
## check parameters
|
||||
if [ "$#" -ne 3 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## check if the systems parameter is valid
|
||||
if ! echo "$SYSTEM_LIST" | grep -w "$3" >/dev/null; then
|
||||
printf "%s\n" "You must enter a valid system name."
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## vars
|
||||
SOURCE="$(
|
||||
cd -- "$1" >/dev/null 2>&1 || exit
|
||||
pwd -P
|
||||
)"
|
||||
TARGET="$(
|
||||
cd -- "$2" >/dev/null 2>&1 || exit
|
||||
pwd -P
|
||||
)"
|
||||
readonly SOURCE
|
||||
readonly TARGET
|
||||
|
||||
readonly HOMEBREW=/home/sergio/roms/homebrew
|
||||
readonly TRANSLATIONS=/home/sergio/roms/translations
|
||||
readonly HACKS=/home/sergio/roms/hacks
|
||||
|
||||
readonly CONSOLE="atari800 atari2600 atari5200 atari7800 coleco fds intellivision mastersystem megadrive n64 nes neogeo pcengine sega32x sg-1000 snes"
|
||||
readonly HANDHELD="atarilynx gamegear gb gba gbc gc ngp ngpc virtualboy wonderswan wonderswancolor"
|
||||
readonly COMPUTER="amiga amstradcpc apple2 atarist c16 c64 c128 msx x68000 zxspectrum"
|
||||
readonly CD_SYSTEM="3do atarijaguar dreamcast megacd ngc pcfx pcenginecd ps2 psp psx saturn segacd wii"
|
||||
readonly ARCADE="arcade cps1 cps2 neogeo"
|
||||
|
||||
case $3 in
|
||||
console)
|
||||
SCAN_SYSTEM=$CONSOLE
|
||||
;;
|
||||
|
||||
handheld)
|
||||
SCAN_SYSTEM=$HANDHELD
|
||||
;;
|
||||
|
||||
computer)
|
||||
SCAN_SYSTEM=$COMPUTER
|
||||
;;
|
||||
|
||||
cd_system)
|
||||
SCAN_SYSTEM=$CD_SYSTEM
|
||||
;;
|
||||
|
||||
arcade)
|
||||
SCAN_SYSTEM=$ARCADE
|
||||
;;
|
||||
|
||||
*)
|
||||
SCAN_SYSTEM=$CONSOLE
|
||||
;;
|
||||
esac
|
||||
|
||||
readonly TEXT1="añadiendo enlaces para "
|
||||
readonly TEXT2=" ..."
|
||||
C_BLUE=$(tput setaf 4)
|
||||
readonly C_BLUE
|
||||
C_NORMAL=$(tput sgr0)
|
||||
readonly C_NORMAL
|
||||
|
||||
## console systems
|
||||
for SYSTEM in $SCAN_SYSTEM; do
|
||||
## check source
|
||||
if test -d "${SOURCE}"/"${SYSTEM}"; then
|
||||
printf "%s\n" "${TEXT1}${C_BLUE}${SYSTEM}${C_NORMAL}${TEXT2}"
|
||||
mkdir -p "${TARGET}"/"${SYSTEM}"
|
||||
for FILE in "${SOURCE}"/"${SYSTEM}"/*; do
|
||||
ln -s "${FILE}" "${TARGET}"/"${SYSTEM}"/"$(basename "${FILE}")"
|
||||
done
|
||||
fi
|
||||
|
||||
## check homebrew
|
||||
if test -d "${HOMEBREW}"/"${SYSTEM}"; then
|
||||
printf "%s\n" "${TEXT1}${C_BLUE}${SYSTEM}/_homebrew${C_NORMAL}${TEXT2}"
|
||||
mkdir -p "${TARGET}"/"${SYSTEM}"/_homebrew
|
||||
for FILE in "${HOMEBREW}"/"${SYSTEM}"/*; do
|
||||
ln -s "${FILE}" "${TARGET}"/"${SYSTEM}"/_homebrew/"$(basename "${FILE}")"
|
||||
done
|
||||
fi
|
||||
|
||||
## check translations
|
||||
if test -d "${TRANSLATIONS}"/"${SYSTEM}"; then
|
||||
printf "%s\n" "${TEXT1}${C_BLUE}${SYSTEM}/_translations${C_NORMAL}${TEXT2}"
|
||||
mkdir -p "${TARGET}"/"${SYSTEM}"/_translations
|
||||
for FILE in "${TRANSLATIONS}"/"${SYSTEM}"/*; do
|
||||
ln -s "${FILE}" "${TARGET}"/"${SYSTEM}"/_translations/"$(basename "${FILE}")"
|
||||
done
|
||||
fi
|
||||
|
||||
## check hacks
|
||||
if test -d "${HACKS}"/"${SYSTEM}"; then
|
||||
printf "%s\n" "${TEXT1}${C_BLUE}${SYSTEM}/_hacks${C_NORMAL}${TEXT2}"
|
||||
mkdir -p "${TARGET}"/"${SYSTEM}"/_hacks
|
||||
for FILE in "${HACKS}"/"${SYSTEM}"/*; do
|
||||
ln -s "${FILE}" "${TARGET}"/"${SYSTEM}"/_hacks/"$(basename "${FILE}")"
|
||||
done
|
||||
fi
|
||||
done
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
readonly APP=/home/sergio/code/bashscript/skyscraper_system.sh
|
||||
readonly LOG=/home/sergio/cronjobs/cronjobs.log
|
||||
readonly SYSTEMS_COMPUTERS="amstradcpc amiga atarist c64"
|
||||
readonly SYSTEMS_OTHER="dreamcast gc nds pcengine psp psx saturn segacd"
|
||||
readonly TODAY=$(date +"%d-%m-%Y")
|
||||
|
||||
printf "\n%s (%s, %s)\n" "$(basename "${0}")" "${TODAY}" "$(date +%A)" >>"${LOG}"
|
||||
|
||||
# /home/sergio/roms/computer
|
||||
for SYSTEM in $SYSTEMS_COMPUTERS; do
|
||||
NOW=$(date +"%T")
|
||||
START=$(date -u +"%s")
|
||||
printf " %-12s %s" "${SYSTEM}:" "${NOW}" >>"${LOG}"
|
||||
|
||||
${APP} scrap /home/sergio/roms/computer "${SYSTEM}"
|
||||
END=$(date -u +"%s")
|
||||
|
||||
ELAPSED=$(($END - $START))
|
||||
E=$(date -ud @$ELAPSED +'%H:%M:%S')
|
||||
|
||||
printf " (%s)\n" "${E}" >>"${LOG}"
|
||||
done
|
||||
|
||||
# /home/sergio/roms/skyscraper
|
||||
for SYSTEM in $SYSTEMS_OTHER; do
|
||||
NOW=$(date +"%T")
|
||||
START=$(date -u +"%s")
|
||||
printf " %-12s %s" "${SYSTEM}:" "${NOW}" >>"${LOG}"
|
||||
|
||||
${APP} scrap /home/sergio/roms/skyscraper "${SYSTEM}"
|
||||
END=$(date -u +"%s")
|
||||
|
||||
ELAPSED=$(($END - $START))
|
||||
E=$(date -ud @$ELAPSED +'%H:%M:%S')
|
||||
|
||||
printf " (%s)\n" "${E}" >>"${LOG}"
|
||||
done
|
||||
|
||||
NOW=$(date +"%T")
|
||||
printf " end: %s\n" "${NOW}" >>"${LOG}"
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
## usage
|
||||
USAGE="USAGE:
|
||||
$(basename "$0") source_file dest_dir
|
||||
readonly USAGE
|
||||
|
||||
function help_message() {
|
||||
printf "%s\n" "$USAGE"
|
||||
}
|
||||
|
||||
## check parameters
|
||||
if [ "$#" -ne 2 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## vars
|
||||
SOURCE=$1
|
||||
readonly SOURCE
|
||||
|
||||
TARGET="$(
|
||||
cd -- "$2" >/dev/null 2>&1 || exit
|
||||
pwd -P
|
||||
)"
|
||||
readonly TARGET
|
||||
|
||||
## test vars
|
||||
if ! test -f "${SOURCE}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -d "${TARGET}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## create link
|
||||
ln -s "${SOURCE}" "${TARGET}"/"$(basename "${SOURCE}")"
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
## usage
|
||||
USAGE="USAGE:
|
||||
$(basename "$0") source_file dest_dir"
|
||||
readonly USAGE
|
||||
|
||||
function help_message() {
|
||||
printf "%s\n" "$USAGE"
|
||||
}
|
||||
|
||||
## check parameters
|
||||
if [ "$#" -ne 2 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## vars
|
||||
SOURCE=$1
|
||||
readonly SOURCE
|
||||
|
||||
TARGET="$(
|
||||
cd -- "$2" >/dev/null 2>&1 || exit
|
||||
pwd -P
|
||||
)"
|
||||
readonly TARGET
|
||||
|
||||
## test vars
|
||||
if ! test -f "${SOURCE}"; then
|
||||
printf "%s\n" "${SOURCE} file does not exist"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -d "${TARGET}"; then
|
||||
printf "%s\n" "${TARGET} path does not exist"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## create zip file
|
||||
NAME=$(basename "${SOURCE}")
|
||||
filename=$(basename -- "$SOURCE")
|
||||
extension="${filename##*.}"
|
||||
filename="${filename%.*}"
|
||||
7z a -tzip -mx=9 "${TARGET}"/"${filename}".zip "${SOURCE}"
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
shopt -s nocasematch
|
||||
shopt -s nocaseglob
|
||||
|
||||
readonly letters="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
||||
readonly numbers="0 1 2 3 4 5 6 7 8 9"
|
||||
|
||||
for i in $letters; do
|
||||
mkdir -p "$i"
|
||||
for element in "$i"*; do
|
||||
if [ "$element" != "$0" ] && [ "$element" != "$i" ]; then
|
||||
mv -v "$element" "$i"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for i in $numbers; do
|
||||
mkdir -p "0-9"
|
||||
for element in "$i"*; do
|
||||
if [ "$element" != "$0" ] && [ "$element" != "$i" ]; then
|
||||
mv -v "$element" "0-9"
|
||||
fi
|
||||
done
|
||||
done
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script para copiar las roms de Retroid Pocket
|
||||
|
||||
## Comprueba los parametros
|
||||
if [ "$#" -ne 1 ]; then
|
||||
printf "No ha especificado destino\n"
|
||||
exit 0
|
||||
else
|
||||
DESTINO=$1
|
||||
readonly DESTINO
|
||||
fi
|
||||
|
||||
# Crea el directorio de destino de copia
|
||||
if ! test -d "$DESTINO"; then
|
||||
mkdir -p "$DESTINO"
|
||||
fi
|
||||
|
||||
# Origen de la copia
|
||||
ORIGEN=maverick:/home/sergio/roms/ROMs_ALL
|
||||
readonly ORIGEN
|
||||
|
||||
# Copia los sistemas con una sola carpeta
|
||||
SISTEMAS="atari2600 atari5200 atari7800 atarilynx colecovision cps1 cps2 cps3 dreamcast fbneo fds gamegear gb gba gbc mastersystem neogeo ngp ngpc odyssey2 psp psx sg-1000 supergrafx virtualboy wonderswan wonderswancolor"
|
||||
readonly SISTEMAS
|
||||
|
||||
OK=1
|
||||
|
||||
if [ "$OK" -ne 0 ]; then
|
||||
|
||||
for SISTEMA in $SISTEMAS; do
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/"${SISTEMA}/" "${DESTINO}/${SISTEMA}/"
|
||||
done
|
||||
|
||||
# SNES
|
||||
SISTEMA=snes
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/snes/ "${ORIGEN}"/snesna/ "${ORIGEN}"/sfc/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# NES
|
||||
SISTEMA=nes
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/nes/ "${ORIGEN}"/famicom/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# MEGACD
|
||||
SISTEMA=megacd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/megacd/ "${ORIGEN}"/megacdjp/ "${ORIGEN}"/segacd/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# 32X
|
||||
SISTEMA=sega32x
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/sega32x/ "${ORIGEN}"/sega32xjp/ "${ORIGEN}"/sega32xna/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# MEGADRIVE
|
||||
SISTEMA=megadrive
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/megadrive/ "${ORIGEN}"/genesis/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# MEGADRIVE
|
||||
SISTEMA=megadrive
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/megadrive/ "${ORIGEN}"/genesis/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# PCENGINE
|
||||
SISTEMA=pcengine
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/pcengine/ "${ORIGEN}"/tg16/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# PCENGINECD
|
||||
SISTEMA=pcenginecd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/pcenginecd/ "${ORIGEN}"/tg-cd/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# NEOGEOCD
|
||||
SISTEMA=neogeocd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/neogeocd/ "${ORIGEN}"/neogeocdjp/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# SATURN
|
||||
SISTEMA=saturn
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/saturnjp/ "${DESTINO}/${SISTEMA}/"
|
||||
fi
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script para copiar las roms de RGBPI
|
||||
|
||||
## Comprueba los parametros
|
||||
if [ "$#" -ne 1 ]; then
|
||||
printf "No ha especificado destino\n"
|
||||
exit 0
|
||||
else
|
||||
DESTINO=$1
|
||||
readonly DESTINO
|
||||
fi
|
||||
|
||||
# Crea el directorio de destino de copia
|
||||
if ! test -d "$DESTINO"; then
|
||||
mkdir -p "$DESTINO"
|
||||
fi
|
||||
|
||||
# Origen de la copia
|
||||
ORIGEN=maverick:/home/sergio/roms/ROMs_ALL
|
||||
readonly ORIGEN
|
||||
|
||||
# Copia los sistemas con una sola carpeta
|
||||
SISTEMAS="dreamcast mastersystem neogeo psx"
|
||||
readonly SISTEMAS
|
||||
|
||||
OK=1
|
||||
|
||||
if [ "$OK" -ne 0 ]; then
|
||||
|
||||
for SISTEMA in $SISTEMAS; do
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/"${SISTEMA}/" "${DESTINO}/${SISTEMA}/"
|
||||
done
|
||||
|
||||
# ARCADE
|
||||
SISTEMA=arcade/fbneo
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/cps1/ "${ORIGEN}"/cps2/ "${ORIGEN}"/cps3/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# SNES
|
||||
SISTEMA=snes
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/snes/ "${ORIGEN}"/snesna/ "${ORIGEN}"/sfc/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# NES
|
||||
SISTEMA=nes
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/nes/ "${ORIGEN}"/famicom/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# MEGACD
|
||||
SISTEMA=segacd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/megacd/ "${ORIGEN}"/megacdjp/ "${ORIGEN}"/segacd/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# 32X
|
||||
SISTEMA=sega32x
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/sega32x/ "${ORIGEN}"/sega32xjp/ "${ORIGEN}"/sega32xna/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# MEGADRIVE
|
||||
SISTEMA=megadrive
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/megadrive/ "${ORIGEN}"/genesis/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# SG-1000
|
||||
SISTEMA=sg1000
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/sg-1000/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# PCENGINE
|
||||
SISTEMA=pcengine
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/pcengine/ "${ORIGEN}"/tg16/ "${ORIGEN}"/supergrafx/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# PCENGINECD
|
||||
SISTEMA=pcenginecd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/pcenginecd/ "${ORIGEN}"/tg-cd/ "${DESTINO}/${SISTEMA}/"
|
||||
|
||||
# NEOGEOCD
|
||||
SISTEMA=neocd
|
||||
printf "\n\n>>> %s\n" "${SISTEMA}"
|
||||
mkdir -p "${DESTINO}/${SISTEMA}"
|
||||
rsync -avhPL --delete --chmod=755 "${ORIGEN}"/neogeocd/ "${ORIGEN}"/neogeocdjp/ "${DESTINO}/${SISTEMA}/"
|
||||
fi
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script para pasar todos los ficheros scr de una ubicación
|
||||
# a otra y convertirlos a gif y cambiarles el tamaño
|
||||
|
||||
SRC=/home/sergio/zx/zxdb/games
|
||||
DST=/home/sergio/zx/scr_packs/zosya
|
||||
|
||||
if [ ! -d ${DST} ]; then
|
||||
mkdir -p ${DST}
|
||||
fi
|
||||
rm ${DST}/*
|
||||
find ${SRC} -type f -iname "*.scr" -exec cp -v {} ${DST} \;
|
||||
scr2gif -f ${DST}/*.scr
|
||||
rm ${DST}/*.scr
|
||||
mogrify -verbose -scale 768x576 ${DST}/*.gif
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Comprueba los parametros
|
||||
if [ "$#" -ne 1 ]; then
|
||||
printf "Uso: %s FILE_NAME\n" "$(basename "$0")"
|
||||
exit 0
|
||||
else
|
||||
# Comprueba si existe el fichero
|
||||
if ! test -f "$1"; then
|
||||
printf "File %s does not exist.\n" "$1"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Variables
|
||||
FILE_DIR="$(cd "$(dirname "$1")" && pwd)"
|
||||
readonly FILE_DIR
|
||||
|
||||
FILE_NAME="$(basename "$1")"
|
||||
readonly FILE_NAME
|
||||
|
||||
SUFFIX=".tar.gz"
|
||||
readonly SUFFIX
|
||||
|
||||
# Crea una copia del fichero y le añade al nombre la fecha
|
||||
OLD_DATE="$(date -r "$1" "+%Y-%m-%d_%H:%M:%S")"
|
||||
cp "${FILE_DIR}/${FILE_NAME}" "${FILE_DIR}/${FILE_NAME}.${OLD_DATE}"
|
||||
|
||||
# Añade la copia del fichero al fichero .tar.gz o crea uno nuevo
|
||||
if ! test -f "${FILE_DIR}/${FILE_NAME}${SUFFIX}"; then
|
||||
tar -C "${FILE_DIR}" -caf "${FILE_DIR}/${FILE_NAME}${SUFFIX}" "${FILE_NAME}.${OLD_DATE}"
|
||||
printf "File %s${SUFFIX} created.\n" "${FILE_NAME}"
|
||||
else
|
||||
gunzip "${FILE_DIR}/${FILE_NAME}${SUFFIX}"
|
||||
tar -C "${FILE_DIR}" -uf "${FILE_DIR}/${FILE_NAME}.tar" "${FILE_NAME}.${OLD_DATE}"
|
||||
gzip "${FILE_DIR}/${FILE_NAME}.tar"
|
||||
fi
|
||||
printf "%s\n" "${FILE_NAME}.${OLD_DATE} added"
|
||||
rm "${FILE_DIR}/${FILE_NAME}.${OLD_DATE}"
|
||||
|
||||
# Comprueba cada cierto tiempo si el fichero se ha modificado
|
||||
while true; do
|
||||
sleep 60
|
||||
# Obten la fecha del fichero
|
||||
DATE="$(date -r "$1" "+%Y-%m-%d_%H:%M:%S")"
|
||||
# Si la fecha del fichero ha cambiado respecto a la que tenia almacenada es porque es una versión
|
||||
# nueva del fichero y se procede a hacer una copia en el fichero .tar.gz
|
||||
if [ "$DATE" != "$OLD_DATE" ]; then
|
||||
# Crea una copia del fichero y le añade al nombre la fecha
|
||||
cp "${FILE_DIR}/${FILE_NAME}" "${FILE_DIR}/${FILE_NAME}.${DATE}"
|
||||
# Añade la copia del fichero al fichero .tar.gz
|
||||
gunzip "${FILE_DIR}/${FILE_NAME}${SUFFIX}"
|
||||
tar -C "${FILE_DIR}" -uf "${FILE_DIR}/${FILE_NAME}.tar" "${FILE_NAME}.${DATE}"
|
||||
gzip "${FILE_DIR}/${FILE_NAME}.tar"
|
||||
# Elimina la copia del fichero
|
||||
rm "${FILE_DIR}/${FILE_NAME}.${DATE}"
|
||||
# Actualiza la fecha del fichero a la de la última copia
|
||||
OLD_DATE=$DATE
|
||||
# Informa por pantalla
|
||||
printf "%s\n" "${FILE_NAME}.${DATE} added"
|
||||
fi
|
||||
done
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
#sony.europe
|
||||
find ~/downloads/psx/europe -type f -iname "*.chd" -mtime +0 -exec mv -v {} ~/chd/Sony\ -\ PlayStation\ \(2020-10-05\)\ \(Redump\)\ \(CHD\)/europe/ \;
|
||||
|
||||
#sony.usa
|
||||
find ~/downloads/psx/usa -type f -iname "*.chd" -mtime +0 -exec mv -v {} ~/chd/Sony\ -\ PlayStation\ \(2020-10-05\)\ \(Redump\)\ \(CHD\)/usa/ \;
|
||||
|
||||
#sony.japan
|
||||
find ~/downloads/psx/japan -type f -iname "*.chd" -mtime +0 -exec mv -v {} ~/chd/Sony\ -\ PlayStation\ \(2020-10-05\)\ \(Redump\)\ \(CHD\)/japan/ \;
|
||||
|
||||
#sony.psp
|
||||
find ~/downloads/psp -type f -iname "*.zip" -mtime +0 -exec mv -v {} ~/chd/Sony\ -\ PlayStation\ Portable\ \(2022-03-21\)\ \(Redump\)/ \;
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
#!/bin/bash
|
||||
function help_message() {
|
||||
echo "$USAGE"
|
||||
echo
|
||||
echo "Where [SYSTEMS] are:"
|
||||
for WORD in $SYSTEMS; do
|
||||
echo -e "\t$WORD"
|
||||
done
|
||||
}
|
||||
|
||||
readonly USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [SYSTEM] [ROM_FOLDER] [PLAYLISTS_FOLDER]"
|
||||
|
||||
readonly SYSTEMS="pcenginecd 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
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# check if the system parameter is valid
|
||||
if ! echo "$SYSTEMS" | grep -w "$1" >/dev/null; then
|
||||
printf "%s\n" "You must enter a valid system name."
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
readonly SYSTEM="$1"
|
||||
readonly ROM_FOLDER="$2"
|
||||
readonly PLAYLISTS_FOLDER="$3"
|
||||
readonly BASE_PATH="/Users/sergio/Roms/roms.retroachievements.2020/"
|
||||
|
||||
if ! test -d "${ROM_FOLDER}"/"${SYSTEM}"; then
|
||||
echo "${ROM_FOLDER}"/"${SYSTEM}" does not exists
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $SYSTEM in
|
||||
|
||||
3do)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
3ds)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
amiga)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
amstradcpc)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
apple2)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
arcade)
|
||||
readonly PLAYLIST_NAME="FBNeo - Arcade Games"
|
||||
;;
|
||||
arcadia)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
astrocde)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari800)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari2600)
|
||||
readonly PLAYLIST_NAME="Atari - 2600"
|
||||
;;
|
||||
atari5200)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari7800)
|
||||
readonly PLAYLIST_NAME="Atari - 7800"
|
||||
;;
|
||||
atarijaguar)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atarilynx)
|
||||
readonly PLAYLIST_NAME="Atari - Lynx"
|
||||
;;
|
||||
atarist)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
c16)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
c64)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
c128)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
coco)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
coleco)
|
||||
readonly PLAYLIST_NAME="Coleco - ColecoVision"
|
||||
;;
|
||||
daphne)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
dragon32)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
dreamcast)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
fba)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
fds)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
gameandwatch)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
gamegear)
|
||||
readonly PLAYLIST_NAME="Sega - Game Gear"
|
||||
;;
|
||||
gb)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy"
|
||||
;;
|
||||
gba)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy Advance"
|
||||
;;
|
||||
gbc)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy Color"
|
||||
;;
|
||||
gc)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
genesis)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
intellivision)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-advmame)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-libretro)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-mame4all)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mastersystem)
|
||||
readonly PLAYLIST_NAME="Sega - Master System - Mark III"
|
||||
;;
|
||||
megacd)
|
||||
readonly PLAYLIST_NAME="Sega - Mega-CD - Sega CD"
|
||||
;;
|
||||
megadrive)
|
||||
readonly PLAYLIST_NAME="Sega - Mega Drive - Genesis"
|
||||
;;
|
||||
msx)
|
||||
readonly PLAYLIST_NAME="Microsoft - MSX"
|
||||
;;
|
||||
msx2)
|
||||
readonly PLAYLIST_NAME="Microsoft - MSX2"
|
||||
;;
|
||||
n64)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo 64"
|
||||
;;
|
||||
nds)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo DS"
|
||||
;;
|
||||
neogeo)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
nes)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo Entertainment System"
|
||||
;;
|
||||
ngp)
|
||||
readonly PLAYLIST_NAME="SNK - Neo Geo Pocket"
|
||||
;;
|
||||
ngpc)
|
||||
readonly PLAYLIST_NAME="SNK - Neo Geo Pocket Color"
|
||||
;;
|
||||
oric)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc88)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc98)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pcfx)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pcengine)
|
||||
readonly PLAYLIST_NAME="NEC - PC Engine - TurboGrafx 16"
|
||||
;;
|
||||
pcenginecd)
|
||||
readonly PLAYLIST_NAME="NEC - PC Engine CD"
|
||||
;;
|
||||
pokemini)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ports)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ps2)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
psp)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
psx)
|
||||
readonly PLAYLIST_NAME="Sony - PlayStation"
|
||||
;;
|
||||
saturn)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
scummvm)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
sega32x)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
segacd)
|
||||
readonly PLAYLIST_NAME="Sega - Mega-CD - Sega CD"
|
||||
;;
|
||||
sg-1000)
|
||||
readonly PLAYLIST_NAME="Sega - SG-1000"
|
||||
;;
|
||||
snes)
|
||||
readonly PLAYLIST_NAME="Nintendo - Super Nintendo Entertainment System"
|
||||
;;
|
||||
steam)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ti99)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
trs-80)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
vectrex)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
vic20)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
videopac)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
virtualboy)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
wii)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
wonderswan)
|
||||
readonly PLAYLIST_NAME="Bandai - WonderSwan"
|
||||
;;
|
||||
wonderswancolor)
|
||||
readonly PLAYLIST_NAME="Bandai - WonderSwan Color"
|
||||
;;
|
||||
x68000)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
x1)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zmachine)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zx81)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zxspectrum)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
if test -f "${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl; then
|
||||
rm "${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl
|
||||
fi
|
||||
touch "${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl
|
||||
|
||||
(echo "{";
|
||||
echo " \"version\": \"1.4\",";
|
||||
echo " \"default_core_path\": \"\",";
|
||||
echo " \"default_core_name\": \"\",";
|
||||
echo " \"label_display_mode\": 0,";
|
||||
echo " \"right_thumbnail_mode\": 0,";
|
||||
echo " \"left_thumbnail_mode\": 0,";
|
||||
echo " \"sort_mode\": 0,";
|
||||
echo " \"items\": [") >>"${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl
|
||||
for CHDFILE in "${ROM_FOLDER}"/*.chd; do
|
||||
GAMENAME="$(basename "$CHDFILE" .chd)"
|
||||
FOLDER="$(basename "$ROM_FOLDER")"
|
||||
(echo " {";
|
||||
echo " \"path\": \"${BASE_PATH}/${FOLDER}/${GAMENAME}.chd\",";
|
||||
echo " \"label\": \"${GAMENAME}\",";
|
||||
echo " \"core_path\": \"DETECT\",";
|
||||
echo " \"core_name\": \"DETECT\",";
|
||||
echo " \"db_name\": \"${PLAYLIST_NAME}.lpl\"";
|
||||
echo " },") >>"${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl
|
||||
done
|
||||
(echo " ]";
|
||||
echo "}") >>"${PLAYLISTS_FOLDER}"/"${PLAYLIST_NAME}".lpl
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
#!/bin/bash
|
||||
function help_message() {
|
||||
printf "%s\n\n" "$USAGE"
|
||||
printf "%s" "Where [SYSTEMS] are:\n"
|
||||
for WORD in $SYSTEMS; do
|
||||
printf "%s" "$WORD "
|
||||
done
|
||||
printf "\n"
|
||||
}
|
||||
|
||||
readonly USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [SYSTEM] [ROM_FOLDER] [THUMBNAILS_FOLDER]"
|
||||
|
||||
readonly SYSTEMS="pcenginecd 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
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# check if the system parameter is valid
|
||||
if ! echo "$SYSTEMS" | grep -w "$1" >/dev/null; then
|
||||
printf "%s\n" "You must enter a valid system name."
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -d "${ROM_FOLDER}"/"${SYSTEM}"; then
|
||||
echo "${ROM_FOLDER}"/"${SYSTEM}" does not exists
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
readonly SYSTEM="$1"
|
||||
readonly ROM_FOLDER="$2"
|
||||
readonly THUMBNAILS_FOLDER="$3"
|
||||
|
||||
case $SYSTEM in
|
||||
|
||||
3do)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
3ds)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
amiga)
|
||||
readonly PLAYLIST_NAME="Commodore - Amiga"
|
||||
;;
|
||||
amstradcpc)
|
||||
readonly PLAYLIST_NAME="Amstrad - CPC"
|
||||
;;
|
||||
apple2)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
arcade)
|
||||
readonly PLAYLIST_NAME="FBNeo - Arcade Games"
|
||||
;;
|
||||
arcadia)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
astrocde)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari800)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari2600)
|
||||
readonly PLAYLIST_NAME="Atari - 2600"
|
||||
;;
|
||||
atari5200)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atari7800)
|
||||
readonly PLAYLIST_NAME="Atari - 7800"
|
||||
;;
|
||||
atarijaguar)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
atarilynx)
|
||||
readonly PLAYLIST_NAME="Atari - Lynx"
|
||||
;;
|
||||
atarist)
|
||||
readonly PLAYLIST_NAME="Atari - ST"
|
||||
;;
|
||||
c16)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
c64)
|
||||
readonly PLAYLIST_NAME="Commodore - 64"
|
||||
;;
|
||||
c128)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
coco)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
coleco)
|
||||
readonly PLAYLIST_NAME="Coleco - ColecoVision"
|
||||
;;
|
||||
daphne)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
dragon32)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
dreamcast)
|
||||
readonly PLAYLIST_NAME="Sega - Dreamcast"
|
||||
;;
|
||||
fba)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
fds)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
gameandwatch)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
gamegear)
|
||||
readonly PLAYLIST_NAME="Sega - Game Gear"
|
||||
;;
|
||||
gb)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy"
|
||||
;;
|
||||
gba)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy Advance"
|
||||
;;
|
||||
gbc)
|
||||
readonly PLAYLIST_NAME="Nintendo - Game Boy Color"
|
||||
;;
|
||||
gc)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
genesis)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
intellivision)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-advmame)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-libretro)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mame-mame4all)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
mastersystem)
|
||||
readonly PLAYLIST_NAME="Sega - Master System - Mark III"
|
||||
;;
|
||||
megacd)
|
||||
readonly PLAYLIST_NAME="Sega - Mega-CD - Sega CD"
|
||||
;;
|
||||
megadrive)
|
||||
readonly PLAYLIST_NAME="Sega - Mega Drive - Genesis"
|
||||
;;
|
||||
msx)
|
||||
readonly PLAYLIST_NAME="Microsoft - MSX"
|
||||
;;
|
||||
msx2)
|
||||
readonly PLAYLIST_NAME="Microsoft - MSX2"
|
||||
;;
|
||||
n64)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo 64"
|
||||
;;
|
||||
nds)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo DS"
|
||||
;;
|
||||
neogeo)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
nes)
|
||||
readonly PLAYLIST_NAME="Nintendo - Nintendo Entertainment System"
|
||||
;;
|
||||
ngp)
|
||||
readonly PLAYLIST_NAME="SNK - Neo Geo Pocket"
|
||||
;;
|
||||
ngpc)
|
||||
readonly PLAYLIST_NAME="SNK - Neo Geo Pocket Color"
|
||||
;;
|
||||
oric)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc88)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pc98)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pcfx)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
pcengine)
|
||||
readonly PLAYLIST_NAME="NEC - PC Engine - TurboGrafx 16"
|
||||
;;
|
||||
pcenginecd)
|
||||
readonly PLAYLIST_NAME="NEC - PC Engine CD"
|
||||
;;
|
||||
pokemini)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ports)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ps2)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
psp)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
psx)
|
||||
readonly PLAYLIST_NAME="Sony - PlayStation"
|
||||
;;
|
||||
saturn)
|
||||
readonly PLAYLIST_NAME="Sega - Saturn"
|
||||
;;
|
||||
scummvm)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
sega32x)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
segacd)
|
||||
readonly PLAYLIST_NAME="Sega - Mega-CD - Sega CD"
|
||||
;;
|
||||
sg-1000)
|
||||
readonly PLAYLIST_NAME="Sega - SG-1000"
|
||||
;;
|
||||
snes)
|
||||
readonly PLAYLIST_NAME="Nintendo - Super Nintendo Entertainment System"
|
||||
;;
|
||||
steam)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
ti99)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
trs-80)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
vectrex)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
vic20)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
videopac)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
virtualboy)
|
||||
readonly PLAYLIST_NAME="Nintendo - Virtualboy"
|
||||
;;
|
||||
wii)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
wonderswan)
|
||||
readonly PLAYLIST_NAME="Bandai - WonderSwan"
|
||||
;;
|
||||
wonderswancolor)
|
||||
readonly PLAYLIST_NAME="Bandai - WonderSwan Color"
|
||||
;;
|
||||
x68000)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
x1)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zmachine)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zx81)
|
||||
readonly PLAYLIST_NAME=""
|
||||
;;
|
||||
zxspectrum)
|
||||
readonly PLAYLIST_NAME="Sinclair - ZX Spectrum"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
if test -d "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"; then
|
||||
rm -rdf "${THUMBNAILS_FOLDER:?}"/"${PLAYLIST_NAME:?}"
|
||||
fi
|
||||
|
||||
mkdir -p "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"
|
||||
mkdir -p "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Boxarts
|
||||
mkdir -p "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Snaps
|
||||
mkdir -p "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Titles
|
||||
|
||||
cp -v "${ROM_FOLDER}"/"${SYSTEM}"/media/covers/* "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Boxarts
|
||||
cp -v "${ROM_FOLDER}"/"${SYSTEM}"/media/screenshots/* "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Snaps
|
||||
|
||||
rename s-[\&\*\:\`\<\>\?\\\|]-_- "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Boxarts/*
|
||||
rename s-[\&\*\:\`\<\>\?\\\|]-_- "${THUMBNAILS_FOLDER}"/"${PLAYLIST_NAME}"/Named_Snaps/*
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
function help_message() {
|
||||
echo "$USAGE"
|
||||
echo
|
||||
echo "Where [SYSTEMS] are:"
|
||||
for WORD in $SYSTEMS; do
|
||||
echo -e "\t$WORD"
|
||||
done
|
||||
}
|
||||
|
||||
readonly USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [ROM_FOLDER] [THUMBNAILS_FOLDER]"
|
||||
|
||||
# check if there are all the parameters
|
||||
if [ "$#" -ne 2 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -d "${ROM_FOLDER}"/"${SYSTEM}"; then
|
||||
echo "${ROM_FOLDER}"/"${SYSTEM}" does not exists
|
||||
exit 0
|
||||
fi
|
||||
|
||||
readonly ROM_FOLDER="$1"
|
||||
readonly THUMBNAILS_FOLDER="$2"
|
||||
readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
readonly SYSTEMS="pcenginecd 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}"
|
||||
done
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
function help_message() {
|
||||
echo "$USAGE"
|
||||
}
|
||||
|
||||
USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [arcade_playlist] [thumbnail_folder]"
|
||||
readonly USAGE
|
||||
|
||||
# check if there are all the parameters
|
||||
if [ "$#" -ne 2 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
readonly ARCADE_PLAYLIST="$1"
|
||||
readonly THUMBNAIL_FOLDER="$2"
|
||||
readonly TEMP_FILE="${THUMBNAIL_FOLDER}"/temp
|
||||
|
||||
if ! test -d "${THUMBNAIL_FOLDER}"; then
|
||||
echo "${THUMBNAIL_FOLDER}" does not exists
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -f "${ARCADE_PLAYLIST}"; then
|
||||
echo "${ARCADE_PLAYLIST}" does not exists
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -d "${THUMBNAIL_FOLDER}".bak; then
|
||||
echo deleted "${THUMBNAIL_FOLDER}".bak
|
||||
rm -rdf "${THUMBNAIL_FOLDER:?}"
|
||||
fi
|
||||
|
||||
if ! test -d "${THUMBNAIL_FOLDER}".bak; then
|
||||
#echo created "${THUMBNAIL_FOLDER}".bak
|
||||
clear
|
||||
fi
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
readonly CURRENT_DIR
|
||||
cd "${THUMBNAIL_FOLDER}" || return
|
||||
rm -v "${TEMP_FILE}"
|
||||
#grep -e \"label\" -e \"path\" "${ARCADE_PLAYLIST}" | sed s-"$(printf '\r')"-OO-g
|
||||
# | sed -E 's- \"path\": \"-cp \"-g' | sed -E 's-^ \"label\": -X-g' | sed -E 's-,$-X-g' > "${TEMP_FILE}"
|
||||
while IFS= read -r line
|
||||
do
|
||||
echo "$line"
|
||||
done < "$input"
|
||||
|
||||
cd "${CURRENT_DIR}" || return
|
||||
date
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# IP o nombre del servidor
|
||||
readonly SERVER=maverick
|
||||
|
||||
# Carpeta del servidore donde se sincronizan los saves
|
||||
readonly DEST=/home/sergio/backup/retroarch/saves/
|
||||
|
||||
# Carpeta de Retroarch con los saves
|
||||
readonly SOURCE=/Users/sergio/Documents/retroarch/saves/
|
||||
|
||||
# Nombre del equipo/carpeta donde se guardaran los saves
|
||||
readonly HOSTNAME=macbook_air
|
||||
|
||||
# Sincroniza la carpeta local con los saves en el servidor
|
||||
rsync -avhP --rsync-path="mkdir -p "${DEST}${HOSTNAME}/" && rsync" "${SOURCE}" "${SERVER}":"${DEST}${HOSTNAME}/"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Este script copia las carpetas y ficheros necesarios desde skraper a es-de
|
||||
|
||||
## Variables
|
||||
ES_DE_FOLDER=/sustancia/downloads/es-de
|
||||
readonly ES_DE_FOLDER
|
||||
|
||||
DOWNLOADED_MEDIA_FOLDER="${ES_DE_FOLDER}"/.emulationstation/downloaded_media
|
||||
readonly DOWNLOADED_MEDIA_FOLDER
|
||||
|
||||
GAMELIST_FOLDER="${ES_DE_FOLDER}"/.emulationstation/gamelists
|
||||
readonly GAMELIST_FOLDER
|
||||
|
||||
SYSTEMS="3do ags amiga amiga1200 amiga600 amigacd32 amstradcpc android apple2 apple2gs arcade astrocde atari2600 atari5200 atari7800 atari800 atarijaguar atarijaguarcd atarilynx atarist atarixe atomiswave bbcmicro c64 cavestory cdimono1 cdtv chailove channelf coco colecovision cps daphne desktop doom dos dragon32 dreamcast easyrpg epic famicom fba fbneo fds flash fmtowns gameandwatch gamegear gb gba gbc gc genesis gx4000 intellivision j2me kodi lutris lutro macintosh mame mame-advmame mame-mame4all mastersystem megacd megacdjp megadrive megaduck mess model2 model3 moonlight moto msx msx1 msx2 msxturbor mugen multivision n3ds n64 n64dd naomi naomigd nds neogeo neogeocd neogeocdjp nes ngp ngpc odyssey2 openbor oric palm pc pc88 pc98 pcengine pcenginecd pcfx pico8 pokemini ports ps2 ps3 ps4 psp psvita psx samcoupe satellaview saturn saturnjp scummvm sega32x sega32xjp sega32xna segacd sfc sg-1000 sgb snes snesna solarus spectravideo steam stratagus sufami supergrafx supervision switch symbian tanodragon tg16 tg-cd ti99 tic80 to8 trs-80 uzebox vectrex vic20 videopac virtualboy wii wiiu wonderswan wonderswancolor x1 x68000 xbox xbox360 zmachine zx81 zxspectrum"
|
||||
readonly SYSTEMS
|
||||
|
||||
for SYSTEM in ${SYSTEMS}; do
|
||||
## Copy media folders
|
||||
if [ -d "${ES_DE_FOLDER}/ROMs/${SYSTEM}/media" ]; then
|
||||
if [ ! -d "${DOWNLOADED_MEDIA_FOLDER}/${SYSTEM}" ]; then
|
||||
mkdir -p "${DOWNLOADED_MEDIA_FOLDER}/${SYSTEM}"
|
||||
fi
|
||||
rsync -avh --delete "${ES_DE_FOLDER}/ROMs/${SYSTEM}/media/" "${DOWNLOADED_MEDIA_FOLDER}/${SYSTEM}/"
|
||||
fi
|
||||
|
||||
## Copy gamelist.xml
|
||||
if [ -f "${ES_DE_FOLDER}/ROMs/${SYSTEM}/gamelist.xml" ]; then
|
||||
if [ ! -d "${GAMELIST_FOLDER}/${SYSTEM}" ]; then
|
||||
mkdir -p "${GAMELIST_FOLDER}/${SYSTEM}"
|
||||
fi
|
||||
rsync -avh --delete "${ES_DE_FOLDER}/ROMs/${SYSTEM}/gamelist.xml" "${GAMELIST_FOLDER}/${SYSTEM}/"
|
||||
fi
|
||||
done
|
||||
Executable
+154
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
|
||||
## usage
|
||||
USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [build | scrap | both] [frontend] [path to roms]"
|
||||
readonly USAGE
|
||||
|
||||
FRONTENDS="emulationstation pegasus"
|
||||
readonly FRONTENDS
|
||||
|
||||
function help_message() {
|
||||
echo "$USAGE"
|
||||
echo
|
||||
echo "Where [FRONTEND] are:"
|
||||
for WORD in $FRONTENDS; do
|
||||
echo -e "\t$WORD"
|
||||
done
|
||||
}
|
||||
|
||||
## check if there are all the parameters
|
||||
if [ "$#" -ne 3 ]; then
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## check if the frontend parameter is valid
|
||||
if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then
|
||||
printf "%s\n" "You must enter a valid FRONTEND name."
|
||||
help_message
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## parameters
|
||||
readonly FRONTEND="$2"
|
||||
readonly ROM_DIR="$3"
|
||||
|
||||
## colors
|
||||
COLOR_WHITE=$(tput setaf 7)
|
||||
COLOR_BACKGROUND_RED=$(tput setab 1)
|
||||
RESET_COLOR=$(tput sgr0)
|
||||
readonly COLOR_WHITE
|
||||
readonly COLOR_BACKGROUND_RED
|
||||
readonly RESET_COLOR
|
||||
|
||||
## artwork.xml
|
||||
readonly CONSOLE_ART=~/.skyscraper/artwork.xml.rgbpi
|
||||
readonly ARCADE_ART=~/.skyscraper/artwork.xml.rgbpi
|
||||
readonly CD_ART=~/.skyscraper/artwork.xml.cover.320x240
|
||||
|
||||
## scrapers
|
||||
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
|
||||
readonly ARCADE_SCRAPERS="screenscraper arcadedb"
|
||||
|
||||
## flags
|
||||
readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative,symlink"
|
||||
readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,symlink"
|
||||
readonly SCRAP_FLAGS_CONSOLE="videos,unattend,noresize,unpack"
|
||||
readonly SCRAP_FLAGS_ARCADE="videos,unattend,noresize"
|
||||
#readonly CACHE_REFRESH="--cache refresh"
|
||||
|
||||
## check if BUID, SCRAP or BOTH
|
||||
if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then
|
||||
BUILD=false
|
||||
SCRAP=true
|
||||
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if [ "$1" = build ] || [ "$1" = BUILD ]; then
|
||||
BUILD=true
|
||||
SCRAP=false
|
||||
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if [ "$1" = both ] || [ "$1" = BOTH ]; then
|
||||
SCRAP=true
|
||||
BUILD=true
|
||||
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP and BUILD ${RESET_COLOR}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
## console systems
|
||||
CONSOLE="3ds amiga amstradcpc apple2 arcadia astrocde atari800 atari2600 atari5200 atari7800 atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 fds gameandwatch gamegear gb gba gbc gc genesis intellivision mastersystem megadrive msx n64 nds nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp scummvm sega32x 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
|
||||
for SCRAPER in $CONSOLE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_CONSOLE}" -p "${SYSTEM}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "$SYSTEM" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
## cd systems
|
||||
CD_SYSTEM="3do atarijaguar dreamcast megacd psx saturn segacd"
|
||||
for SYSTEM in $CD_SYSTEM; do
|
||||
if test -d "${ROM_DIR}"/"${SYSTEM}"; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $CONSOLE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_CONSOLE}" -p "${SYSTEM}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CD_ART -p "$SYSTEM" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
## arcade systems
|
||||
ARCADE="fba neogeo mame-advmame mame-mame4all mame-libretro"
|
||||
for SYSTEM in $ARCADE; do
|
||||
if test -d "${ROM_DIR}"/"${SYSTEM}"; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $ARCADE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_ARCADE}" -p "$SYSTEM" -s "$SCRAPER" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_ARCADE}" -a $ARCADE_ART -p "$SYSTEM" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
## pcenginecd folder
|
||||
if test -d "${ROM_DIR}"/pcenginecd; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $CONSOLE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_CONSOLE}" -p pcengine -s "$SCRAPER" -i "${ROM_DIR}"/pcenginecd
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CD_ART -p pcengine -f "${FRONTEND}" -i "${ROM_DIR}"/pcenginecd
|
||||
fi
|
||||
fi
|
||||
|
||||
## arcade folder
|
||||
if test -d "${ROM_DIR}"/arcade; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $ARCADE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_ARCADE}" -p fba -s "$SCRAPER" -i "${ROM_DIR}"/arcade
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_ARCADE}" -a $ARCADE_ART -p fba -f "${FRONTEND}" -i "${ROM_DIR}"/arcade
|
||||
fi
|
||||
fi
|
||||
|
||||
## post-script job. add extensions text to pegasus
|
||||
find "${ROM_DIR}" -type f -iname "metadata.pegasus.txt" -exec sed -i '2 a extensions: zip, chd, cue, iso, cso' {} \;
|
||||
Executable
+130
@@ -0,0 +1,130 @@
|
||||
#!/bin/bash
|
||||
USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [BUILD or SCRAP] [PATH] [SYSTEM]"
|
||||
|
||||
function help_message() {
|
||||
printf "%s\n\n" "$USAGE"
|
||||
printf "%s" "Where [SYSTEM] are: "
|
||||
for WORD in $SYSTEMS; do
|
||||
printf "%s " "$WORD"
|
||||
done
|
||||
printf "\n"
|
||||
}
|
||||
readonly USAGE
|
||||
|
||||
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"
|
||||
readonly APP=/usr/local/bin/Skyscraper
|
||||
|
||||
## 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
|
||||
|
||||
## colors
|
||||
COLOR_WHITE=$(tput setaf 7)
|
||||
COLOR_BACKGROUND_RED=$(tput setab 1)
|
||||
RESET_COLOR=$(tput sgr0)
|
||||
readonly COLOR_WHITE
|
||||
readonly COLOR_BACKGROUND_RED
|
||||
readonly RESET_COLOR
|
||||
|
||||
## variables
|
||||
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
readonly ROM_DIR="$2"
|
||||
readonly SYSTEM_NAME="$3"
|
||||
readonly FRONTEND="emulationstation"
|
||||
|
||||
## artwork
|
||||
readonly CONSOLE_ART=artwork.xml
|
||||
readonly ARCADE_ART=artwork.xml
|
||||
|
||||
## scrapers
|
||||
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
|
||||
readonly ARCADE_SCRAPERS="screenacraper arcadedb"
|
||||
|
||||
## flags
|
||||
readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative,symlink"
|
||||
readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,symlink"
|
||||
readonly SCRAP_FLAGS_CONSOLE="videos,unattend,noresize,unpack"
|
||||
readonly SCRAP_FLAGS_ARCADE="videos,unattend,noresize"
|
||||
|
||||
## systems
|
||||
readonly 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"
|
||||
readonly ARCADE="arcade fba neogeo mame-advmame mame-mame4all"
|
||||
|
||||
if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then
|
||||
BUILD=false
|
||||
SCRAP=true
|
||||
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if [ "$1" = build ] || [ "$1" = BUILD ]; then
|
||||
BUILD=true
|
||||
SCRAP=false
|
||||
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
## console systems
|
||||
if echo "${CONSOLE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
|
||||
if [ "${SCRAP}" = true ]; then
|
||||
for SCRAPER in ${CONSOLE_SCRAPERS}; do
|
||||
$APP --flags "${SCRAP_FLAGS_CONSOLE}" -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
|
||||
done
|
||||
fi
|
||||
if [ "${BUILD}" = true ]; then
|
||||
$APP --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## arcade systems
|
||||
if echo "${ARCADE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
|
||||
if [ "${SCRAP}" = true ]; then
|
||||
for SCRAPER in ${ARCADE_SCRAPERS}; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_ARCADE}" -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
|
||||
done
|
||||
fi
|
||||
if [ "${BUILD}" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_ARCADE}" -a $ARCADE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## pcenginecd folder
|
||||
if [ "${SYSTEM_NAME}" = pcenginecd ]; then
|
||||
if test -d "${ROM_DIR}"/pcenginecd; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $CONSOLE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_CONSOLE}" -p pcengine -s "$SCRAPER" -i "${ROM_DIR}"/pcenginecd
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p pcengine -f "${FRONTEND}" -i "${ROM_DIR}"/pcenginecd
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
## arcade folder
|
||||
if [ "${SYSTEM_NAME}" = arcade ]; then
|
||||
if test -d "${ROM_DIR}"/arcade; then
|
||||
if [ "$SCRAP" = true ]; then
|
||||
for SCRAPER in $ARCADE_SCRAPERS; do
|
||||
Skyscraper --flags "${SCRAP_FLAGS_ARCADE}" -p fba -s "$SCRAPER" -i "${ROM_DIR}"/arcade
|
||||
done
|
||||
fi
|
||||
if [ "$BUILD" = true ]; then
|
||||
Skyscraper --flags "${BUILD_FLAGS_ARCADE}" -a $ARCADE_ART -p fba -f "${FRONTEND}" -i "${ROM_DIR}"/arcade
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
TOKEN="5383183749:AAHV8pc9yN_h_LNfixOJXAvVYCNcby0HlCY"
|
||||
ID="717637871"
|
||||
MENSAJE=$1
|
||||
URL="https://api.telegram.org/bot$TOKEN/sendMessage"
|
||||
|
||||
curl -s -X POST $URL -d chat_id=$ID -d text="$MENSAJE" > /dev/null
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
TOKEN="5383183749:AAHV8pc9yN_h_LNfixOJXAvVYCNcby0HlCY"
|
||||
ID="717637871"
|
||||
MENSAJE=$(</dev/stdin)
|
||||
URL="https://api.telegram.org/bot$TOKEN/sendMessage"
|
||||
|
||||
curl -s -X POST $URL -d chat_id=$ID -d text="$MENSAJE" > /dev/null
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Envia un magick packet a la direccion del NAS
|
||||
wakeonlan 00:11:32:76:bf:41
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept zip --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 1 -E -e robots=off -U mozilla https://archive.org/download/no-ndsdec2021
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept zip --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 1 -E -e robots=off -U mozilla https://archive.org/download/redump.psp
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept zip --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 1 -E -e robots=off -U mozilla https://archive.org/download/redump.psp.p2
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept chd --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 2 -E -e robots=off -U mozilla https://archive.org/download/chd_psx_eur/CHD-PSX-EUR/
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept chd --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 1 -E -e robots=off -U mozilla https://archive.org/download/chd_psx_jap/CHD-PSX-JAP/
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
wget --accept chd --continue --no-directories --no-parent --no-clobber --random-wait -r -p --level 1 -E -e robots=off -U mozilla https://archive.org/download/chd_psx/CHD-PSX-USA/
|
||||
Reference in New Issue
Block a user