Last active
August 15, 2020 08:47
-
-
Save Mailaender/1c9962667f1c453598523db8be51b9bc to your computer and use it in GitHub Desktop.
Install the Command & Conquer: Red Alert 2 Yuris Revenge files for OpenRA on Linux/Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Die on any error for Travis CI to automatically retry: | |
set -e | |
function download_url() { | |
URL="$1" | |
LOCAL_FILE="${1##*/}" | |
if [ -x "$(type -P wget)" ]; then | |
wget -O "${LOCAL_FILE}" "${URL}" --no-check-certificate | |
elif [ -x "$(type -P curl)" ]; then | |
curl -f -o "${LOCAL_FILE}" "${URL}" | |
else | |
echo "No supported download method found." 1>&2 | |
return 1 | |
fi | |
} | |
if [ "$(uname)" == "Darwin" ]; then | |
DIR="$HOME/Library/Application Support/OpenRA/Content/ra2" | |
else | |
DIR="$HOME/.config/openra/Content/ra2/" | |
fi | |
#if the directory already exists then exit | |
[ ! -d "${DIR}" ] && mkdir -p "${DIR}" || { | |
cd "${DIR}" | |
#only exit if there's existing content | |
if ls *.mix &> /dev/null; then | |
exit 0 | |
fi | |
} | |
echo "Downloading mod content" | |
cd "${DIR}" | |
#download the file else exit non-zero | |
download_url "https://xwis.net/Dl/Red-Alert-2-Multiplayer.exe" | |
7z e Red-Alert-2-Multiplayer.exe | |
download_url "https://xwis.net/Dl/Yuris-Revenge-Multiplayer.exe" | |
7z e Yuris-Revenge-Multiplayer.exe | |
rm *.exe *.dll *.DLL *.wav *.mmp *.CFG *.WAR *.cache | |
#music | |
download_url "https://xwis.net/dl/thememd.mix" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment