Skip to content

Commit

Permalink
fix(mc): add Java 16 as a dependency requirement for Ubuntu 20.04 and…
Browse files Browse the repository at this point in the history
… above (#3482)

* Added java info to details for game servers that require it
* added openjdk-16-jre option for Ubuntu server
  • Loading branch information
dgibbs64 authored Jun 9, 2021
1 parent 19ac561 commit 2a7fd6f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lgsm/functions/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,20 @@ fn_deps_build_debian(){
# Hurtword/Rust
elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
array_deps_required+=( lib32z1 )
# Minecraft, Rising World, Wurm
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then
# Minecraft, Rising World
elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then
javaversion=$(java -version 2>&1 | grep "version")
if [ "${javaversion}" ]; then
# Added for users using Oracle JRE to bypass the check.
javacheck=1
else
if { [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.04" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "21.04" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.04" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "21.04" ]; }; then
array_deps_required+=( openjdk-16-jre )
else
array_deps_required+=( default-jre )
fi
fi
elif [ "${shortname}" == "rw" ]; then
javaversion=$(java -version 2>&1 | grep "version")
if [ "${javaversion}" ]; then
# Added for users using Oracle JRE to bypass the check.
Expand Down
4 changes: 4 additions & 0 deletions lgsm/functions/info_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ else
fi
fi

if [ "$(command -V java 2>/dev/null)" ]; then
javaversion=$(java -version 2>&1 | grep "version")
fi

## Uptime
uptime=$(</proc/uptime)
uptime=${uptime/[. ]*/}
Expand Down
3 changes: 3 additions & 0 deletions lgsm/functions/info_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ fn_info_message_distro(){
echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
echo -e "${lightblue}tmux:\t${default}${tmuxv}"
echo -e "${lightblue}glibc:\t${default}${glibcversion}"
if [ -n "${javaram}" ]; then
echo -e "${lightblue}Java:\t${default}${javaversion}"
fi
} | column -s $'\t' -t
}

Expand Down

0 comments on commit 2a7fd6f

Please sign in to comment.