created file_to_link.sh
This commit is contained in:
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
readonly BASEDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
readonly SOURCE=~/roms/filtered
|
||||
readonly C_BLUE=$(tput setaf 4)
|
||||
readonly C_NORMAL=$(tput sgr0)
|
||||
|
||||
# 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
+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
+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}")"
|
||||
Reference in New Issue
Block a user