#!/bin/bash
set -e

YUM_PACKAGE_NAME="tar wget libvdpau libva xcb-util-wm xcb-util-image libxcb xcb-util-keysyms xcb-util-renderutil pcre2"
DEB_PACKAGE_NAME="tar wget libva2 libva-drm2 libva-x11-2 libvdpau1 libxcb-xinerama0 libxcb-xinput0 traceroute libpcre2-dev"

 if cat /etc/*release | grep ^NAME | grep Fedora; then
    echo "================================================"
    echo "Installing packages $YUM_PACKAGE_NAME on Fedora"
    echo "================================================"
    pkexec yum install -y $YUM_PACKAGE_NAME
 elif cat /etc/*release | grep ^NAME | grep Ubuntu; then
    echo "==============================================="
    echo "Installing packages $DEB_PACKAGE_NAME on Ubuntu"
    echo "==============================================="
    pkexec apt-get install -y $DEB_PACKAGE_NAME
 else
    echo "OS NOT DETECTED, couldn't install package $PACKAGE"
    exit 1;
 fi
 
wget 'https://boosteroid.com/linux/installer/boosteroid_portable.tar'
mkdir BoosteroidGamesS.R.L.
tar xf boosteroid_portable.tar -C BoosteroidGamesS.R.L./
if [ -f "boosteroid_portable.tar" ]; then
  rm boosteroid_portable.tar
fi
exit 0
