Skip to content

Instantly share code, notes, and snippets.

@aquaductape
Created June 14, 2020 04:41
Show Gist options
  • Save aquaductape/39a03f4b939daddec18aee2ec7c78a9c to your computer and use it in GitHub Desktop.
Save aquaductape/39a03f4b939daddec18aee2ec7c78a9c to your computer and use it in GitHub Desktop.
Need for Madness installation file for Linux
#!/usr/bin/env bash
PWD=`pwd`
ZULU_URL='https://cdn.azul.com/zulu/bin/zulu7.38.0.11-ca-jdk7.0.262-linux_x64.tar.gz'
ZULU='zulu-jdk7'
ZULU_ARCHIVE="/opt/${ZULU}.tar.gz"
USER_DATA="${PWD}/data/user.data"
JAVA7="/opt/${ZULU}/bin/java"
# if last activity was using a car that belonged to your account
# next time you open NFM
# game will be stuck on loading your account cars list
# but it resets graphics, and you'll have to go through tutorial
# your account is still saved though
if [ -f "${USER_DATA}" ]
then
sed -i '/lastcar/d' "${USER_DATA}"
sed -i '/graphics/d' "${USER_DATA}"
fi
if [ ! -f $JAVA7 ]
then
echo "Downloading Java 7 from zulu"
sudo curl $ZULU_URL -o $ZULU_ARCHIVE
echo "extracting Java 7 ... "
sudo mkdir ${ZULU_ARCHIVE%.tar*}
sudo tar --extract --file=${ZULU_ARCHIVE} --strip-components=1 --directory=${ZULU_ARCHIVE%.tar*}
sudo rm $ZULU_ARCHIVE
echo "Running Game ..."
$JAVA7 -jar Game.jar 2>/dev/null &
else
$JAVA7 -jar Game.jar 2>/dev/null &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment