File tibia-install of Package tibia-installer

#!/bin/bash

set -e

TIBIA_CLIENT="https://static.tibia.com/download/tibia.x64.tar.gz"
TIBIA_CLIENT_FILENAME="tibia.x64.tar.gz"
GAMES_DIRECTORY="$HOME/Games"
TIBIA_DIRECTORY="$GAMES_DIRECTORY/Tibia"

if [ $UID -lt 1000 ]; then
	echo "This script is not meant to be run by special users. Aborting."
	exit 1
fi

# Prevent the script from running outside a terminal.
if [ ! -t 0 ]; then
	exit 1
fi

echo "Removing your previous Tibia installation directory: $TIBIA_DIRECTORY"
rm -rf $TIBIA_DIRECTORY

echo "Creating new Tibia installation directory: $TIBIA_DIRECTORY"
mkdir -p $GAMES_DIRECTORY
cd $GAMES_DIRECTORY

echo "Downloading the latest Tibia client for Linux x86_64..."
wget -q --show-progress $TIBIA_CLIENT

echo "Extracting the Tibia client here: $TIBIA_DIRECTORY"
tar -xf $TIBIA_CLIENT_FILENAME
rm -f $TIBIA_CLIENT_FILENAME

echo ""
echo "Success! Have fun playing Tibia."
echo "You can simply run 'tibia' from any terminal to launch the game."
echo "Remember Tibia has its own built-in updater, so you don't need to run this script to update the game."
echo "Bear in mind if you run this script again, it will always repeat the same process, and that might be useful if your installation is ever corrupted."
exit 0
openSUSE Build Service is sponsored by