Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions root/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ CreateRomFolders () {
mkdir -p /input/gbc
fi

if [ ! -d "/input/gc" ]; then
log "Created: /input/gc"
mkdir -p /input/gc
fi

if [ ! -d "/input/intellivision" ]; then
log "Created: /input/intellivision"
mkdir -p /input/intellivision
Expand Down Expand Up @@ -489,6 +494,14 @@ for folder in $(ls /input); do
keepCompressed=true
fi

if echo "$folder" | grep "^gc$" | read; then
ConsoleId=16
ConsoleName="GameCube"
ConsoleDirectory="gc"
ArchiveUrl="$(curl -s "https://archive.org/download/GCRedumpNKitPart1" | grep ".nkit.gcz" | grep -io '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//i' -e 's/["'"'"']$//i' | sed 's/\///g' | sort -u | sed 's|^|https://archive.org/download/GCRedumpNKitPart1/|')"
keepCompressed=true
fi

if echo "$folder" | grep "^nes$" | read; then
ConsoleId=7
ConsoleName="Nintendo Entertainment System"
Expand Down Expand Up @@ -850,6 +863,9 @@ for folder in $(ls /input); do
*.iso|*.ISO)
Type=iso
;;
*.nkit.gcz|*.NKIT.GCZ)
Type=nkit
;;
esac

log "$ConsoleName :: $currentsubprocessid of $DlCount :: $romFile :: Downloading..."
Expand All @@ -869,6 +885,8 @@ for folder in $(ls /input); do
DownloadVerification="$(chdman verify -i "$DownloadOutput" &>/dev/null; echo $?)"
elif [ "$Type" = "iso" ]; then
DownloadVerification="0"
elif [ "$Type" = "nkit" ]; then
DownloadVerification="0"
fi
if [ "$DownloadVerification" = "0" ]; then
log "$ConsoleName :: $currentsubprocessid of $DlCount :: $romFile :: Download Complete!"
Expand All @@ -894,6 +912,9 @@ for folder in $(ls /input); do
elif [ "$Type" = "iso" ]; then
log "$ConsoleName :: $currentsubprocessid of $DlCount :: $romFile :: Moving to /input/$folder"
mv "$DownloadOutput" "/input/$folder"
elif [ "$Type" = "nkit" ]; then
log "$ConsoleName :: $currentsubprocessid of $DlCount :: $romFile :: Moving to /input/$folder"
mv "$DownloadOutput" "/input/$folder"
fi
log "$ConsoleName :: $currentsubprocessid of $DlCount :: $romFile :: Done!"
if [ ! -d /config/logs/downloaded ]; then
Expand Down