A bash script for correctly linking the games and music tracks and expansions within the GOG release of _Quake II: Quad Damage_.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

7 years ago
#!/bin/bash
echo "Track linker for Quake II Quad Damage (GOG edition)"
baseq2=("baseq2" 10 2 3 4 5 6 7 8 9 10 11)
xatrix=("xatrix" 10 9 13 14 7 16 2 15 3 4 18)
raven=("raven" 10 12 13 14 15 16 17 18 19 20 21)
games=(baseq2[@] xatrix[@] raven[@])
for g in ${games[@]}; do
eval current_game=($g)
title=${!current_game:0:1}
trackcount=${!current_game:1:1}
echo "=============================="
echo "=============================="
echo "Current game: $title"
echo "Number of tracks: $trackcount"
echo "=============================="
echo "Creating "$title/music" (if not present)..."
mkdir -p "$title/music"
echo "Creating track links..."
echo "------------------------------"
cd "$title/music"
for ((t = 2; t<trackcount+2; t++)); do
TARGET=$(printf "%02d" ${!current_game:t:1})
LINK_NAME=$(printf "%02d" $t)
echo ">> Track $LINK_NAME -> $TARGET..."
ln -s ../../music/$TARGET.ogg $LINK_NAME.ogg
done
echo "------------------------------"
echo "------------------------------"
cd ../..
echo "Successfully linked $title!"
done
echo "All done! Now get fraggin'! :D"
exit 0