Skip to content

Instantly share code, notes, and snippets.

@witchymary
Created June 17, 2020 18:11
Show Gist options
  • Save witchymary/2c77c3c1770536f51d6a757cec0d1d9a to your computer and use it in GitHub Desktop.
Save witchymary/2c77c3c1770536f51d6a757cec0d1d9a to your computer and use it in GitHub Desktop.
#!/bin/bash
# If $DOWNLOAD_PATH is not defined, use the script path
[ ! -n "$DOWNLOAD_PATH" ] && DOWNLOAD_PATH=$(dirname "$(readlink -f "$0")")
cd $DOWNLOAD_PATH
# Geting the file to find the newest Unofficial Patch Download URL
wget https://www.moddb.com/downloads/start/194719/all -O mirrors.txt
MIRROR=$(grep -m1 'Start' 'mirrors.txt')
# Get the executable filename
FILE_NAME=$(grep -oP '(VTMBup[0-9a-z]*.exe)' <<< $MIRROR)
# Get the download URL
URL="https://www.moddb.com/"$(grep -oP 'downloads(\/[\w]*)+' <<< $MIRROR)
echo "Downloading $FILE_NAME from $URL"
# Download the Unofficial Patch
wget -c --retry-connrefused "$URL" -O vtmbup.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment