Skip to content

Commit

Permalink
Merge branch 'develop' into feature/2702-wurm-java
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Mar 10, 2020
2 parents 2c8b04c + 4b06363 commit 4bf7b7a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -19,7 +19,7 @@ addons:
- postfix
- jq
- lib32gcc1
- libstdc++6:i386
- lib32stdc++6
- shellcheck
- libcurl4-openssl-dev
- libdw-dev
Expand Down
90 changes: 53 additions & 37 deletions lgsm/functions/check_deps.sh
Expand Up @@ -35,7 +35,7 @@ fn_install_mono_repo(){
cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
eval "${cmd}"
else
fn_print_warn_nl "Installing Mono repository"
fn_print_warn_nl "Installing Mono repository."
echo -e "Mono auto install not available for ${distroname}"
echo -e " Follow instructions on mono site to install the latest version of Mono."
echo -e " https://www.mono-project.com/download/stable/#download-lin"
Expand Down Expand Up @@ -91,11 +91,11 @@ fn_install_mono_repo(){
fi
fi
else
fn_print_information_nl "Installing Mono repository"
fn_print_information_nl "Installing Mono repository."
echo -e ""
fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository."
fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository."
echo -e " Follow instructions on mono site to install the latest version of Mono."
echo -e "* Follow instructions on mono site to install the latest version of Mono."
echo -e " https://www.mono-project.com/download/stable/#download-lin"
fi
fi
Expand All @@ -105,7 +105,7 @@ fn_install_universe_repo(){
# Defensive coding - As this is an ubuntu only issue then check to make sure this fix is needed, and we are using ubuntu.
if [ "${jquniversemissing}" != "0" ]&&[ "${distroid}" == "ubuntu" ]; then
fn_print_warning_nl "Ubuntu 18.04.1 contains a bug which means the sources.list file does not populate with the Ubuntu universe repository."
fn_print_information_nl "Attempting to add Universe Repo"
fn_print_information_nl "Attempting to add universe repository."
if [ "${autoinstall}" == "1" ]; then
sudo -n true > /dev/null 2>&1
else
Expand All @@ -131,7 +131,8 @@ fn_install_universe_repo(){
else
fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository."
fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository."
echo -e " Please run the following command as a user with sudo access, and re-run the installation"
echo -e "* Please run the following command as a user with sudo access, and re-run the installation"
echo -e ""
echo -e " sudo apt-add-repository universe"
fi
fi
Expand Down Expand Up @@ -228,7 +229,7 @@ fn_found_missing_deps(){
fn_install_mono_repo
fi
if [ -n "${jqstatus}" ]; then
fn_print_warning_nl "jq is not available in the ${distroname} repository"
fn_print_warning_nl "jq is not available in the ${distroname} repository."
echo -e " * https://docs.linuxgsm.com/requirements/jq"
fi
if [ "${autoinstall}" == "1" ]; then
Expand Down Expand Up @@ -257,8 +258,8 @@ fn_found_missing_deps(){
eval "${cmd}"
fi
if [ $? != 0 ]; then
fn_print_failure_nl "Unable to install dependencies"
fn_script_log_fatal "Unable to install dependencies"
fn_print_failure_nl "Unable to install dependencies."
fn_script_log_fatal "Unable to install dependencies."
echo -e ""
fn_print_warning_nl "Manually install dependencies."
fn_script_log_warn "Manually install dependencies."
Expand All @@ -276,19 +277,19 @@ fn_found_missing_deps(){
core_exit.sh
fi
else
fn_print_complete_nl "Install dependencies completed"
fn_script_log_pass "Install dependencies completed"
fn_print_complete_nl "Install dependencies completed."
fn_script_log_pass "Install dependencies completed."
fi
else
echo -e ""
fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies."
fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies."
echo -e ""
if [ "$(command -v dpkg-query 2>/dev/null)" ]; then
echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
echo -e "sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
elif [ "$(command -v dnf 2>/dev/null)" ]; then
echo -e " sudo dnf install ${array_deps_missing[@]}"
echo -e "sudo dnf install ${array_deps_missing[@]}"
elif [ "$(command -v yum 2>/dev/null)" ]; then
echo -e " sudo yum install ${array_deps_missing[@]}"
echo -e "sudo yum install ${array_deps_missing[@]}"
fi
if [ "${steamcmdfail}" ]; then
echo -e ""
Expand All @@ -303,8 +304,8 @@ fn_found_missing_deps(){
fi
else
if [ "${function_selfname}" == "command_install.sh" ]; then
fn_print_information_nl "Required dependencies already installed"
fn_script_log_info "Required dependencies already installed"
fn_print_information_nl "Required dependencies already installed."
fn_script_log_info "Required dependencies already installed."
fi
fi
}
Expand Down Expand Up @@ -339,7 +340,7 @@ fn_deps_build_debian(){

# Game Specific requirements.

# Natural Selection 2 - x64 only.
# Natural Selection 2 (x64 only)
if [ "${shortname}" == "ns2" ]; then
array_deps_required+=( speex libtbb2 )
# NS2: Combat
Expand All @@ -348,14 +349,14 @@ fn_deps_build_debian(){
# 7 Days to Die
elif [ "${shortname}" == "sdtd" ]; then
array_deps_required+=( telnet expect )
# No More Room in Hell, Counter-Strike: Source and Garry's Mod
# No More Room in Hell, Counter-Strike: Source, Garry's Mod and Zombie Panic: Source
elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
if [ "${arch}" == "x86_64" ]; then
array_deps_required+=( lib32tinfo5 )
else
array_deps_required+=( libtinfo5 )
fi
# Brainbread 2 ,Don't Starve Together & Team Fortress 2
# Brainbread 2, Don't Starve Together & Team Fortress 2
elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
array_deps_required+=( libcurl4-gnutls-dev:i386 )
if [ "${shortname}" == "tf2" ]; then
Expand All @@ -364,27 +365,24 @@ fn_deps_build_debian(){
# Battlefield: 1942
elif [ "${shortname}" == "bf1942" ]; then
array_deps_required+=( libncurses5:i386 )
# Call of Duty
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
# Call of Duty & Medal of Honor: Allied Assault
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then
array_deps_required+=( libstdc++5:i386 )
# Factorio
elif [ "${shortname}" == "fctr" ]; then
array_deps_required+=( xz-utils )
# Hurtword/Rust
elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
array_deps_required+=( lib32z1 )
# Minecraft
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "wurm" ]; then
# Minecraft, Rising World, Wurm
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wurm" ]; then
javaversion=$(java -version 2>&1 | grep "version")
if [ "${javaversion}" ]; then
# Added for users using Oracle JRE to bypass the check.
javacheck=1
else
array_deps_required+=( openjdk-8-jre-headless )
array_deps_required+=( default-jre )
fi
# Medal of Honor: Allied Assault
elif [ "${shortname}" == "mohaa" ]; then
array_deps_required+=( libstdc++5:i386 )
# Onset
elif [ "${shortname}" == "onset" ]; then
array_deps_required+=( libmariadbclient-dev )
Expand Down Expand Up @@ -418,6 +416,9 @@ fn_deps_build_debian(){
# Unreal Tournament
elif [ "${shortname}" == "ut" ]; then
array_deps_required+=( unzip )
# Unturned
elif [ "${shortname}" == "unt" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xvfb )
Expand Down Expand Up @@ -478,36 +479,50 @@ fn_deps_build_redhat(){
# Battlefield: 1942
elif [ "${shortname}" == "bf1942" ]; then
array_deps_required+=( ncurses-libs.i686 )
# Call of Duty
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
# Call of Duty & Medal of Honor: Allied Assault
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then
array_deps_required+=( compat-libstdc++-33.i686 )
# Factorio
elif [ "${shortname}" == "fctr" ]; then
array_deps_required+=( xz )
# Hurtword/Rust
elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
array_deps_required+=( zlib-devel )
# Minecraft, Project Zomboid, Rising World
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "wurm" ]; then
# Minecraft, Rising World, Wurm
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wurm" ]; then
javaversion=$(java -version 2>&1 | grep "version")
if [ "${javaversion}" ]; then
# Added for users using Oracle JRE to bypass the check.
javacheck=1
array_deps_required+=( rng-tools )
else
array_deps_required+=( java-1.8.0-openjdk rng-tools )
array_deps_required+=( java-11-openjdk )
fi
# Onset
# Onset
elif [ "${shortname}" == "onset" ]; then
array_deps_required+=( mariadb-connector-c )
# Project Zomboid
elif [ "${shortname}" == "pz" ]; then
if java -version 2>&1 | grep "version"; then
# Added for users using Oracle JRE to bypass the check.
javacheck=1
array_deps_required+=( rng-tools )
else
array_deps_required+=( java-11-openjdk rng-tools )
fi
# GoldenEye: Source
elif [ "${shortname}" == "ges" ]; then
array_deps_required+=( zlib.i686 openldap.i686 )
# Serious Sam 3: BFE
elif [ "${shortname}" == "ss3" ]; then
: # not compatible
elif [ "${shortname}" == "sven" ]; then
: # not compatible
# Unreal Engine
elif [ "${executable}" == "./ucc-bin" ]; then
#UT2K4
# UT2K4
if [ -f "${executabledir}/ut2004-bin" ]; then
array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 )
#UT99
# UT99
else
array_deps_required+=( SDL.i686 bzip2 )
fi
Expand All @@ -517,6 +532,7 @@ fn_deps_build_redhat(){
# Unturned
elif [ "${shortname}" == "unt" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xorg-x11-server-Xvfb )
elif [ "${shortname}" == "pstbs" ]; then
Expand Down Expand Up @@ -548,5 +564,5 @@ if [ -f "/etc/debian_version" ]; then
elif [ -f "/etc/redhat-release" ]; then
fn_deps_build_redhat
else
fn_print_warning_nl "${distroname} dependency checking unavailable"
fn_print_warning_nl "${distroname} dependency checking unavailable."
fi
10 changes: 9 additions & 1 deletion lgsm/functions/info_distro.sh
Expand Up @@ -232,7 +232,15 @@ if [ -z "${extip}" ]; then
exitcode=$?
# Should ifconfig.co return an error will use last known IP.
if [ ${exitcode} -eq 0 ]; then
echo -e "${extip}" > "${tmpdir}/extip.txt"
if [[ "${extip}" != *"DOCTYPE"* ]]; then
echo -e "${extip}" > "${tmpdir}/extip.txt"
else
if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt")
else
echo -e "x.x.x.x"
fi
fi
else
if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt")
Expand Down

0 comments on commit 4bf7b7a

Please sign in to comment.