Update apache-tomcat-install.sh

This commit is contained in:
CanbiZ 2025-03-03 13:50:16 +01:00
parent a65a870fc7
commit a31a7296f0

View File

@ -5,7 +5,7 @@
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
@ -31,14 +31,15 @@ msg_ok "Set up Adoptium Repository"
read -r -p "Which Tomcat version would you like to install? (9, 10.1, 11): " version
case $version in
9)
9)
TOMCAT_VERSION="9"
echo "Which LTS Java version would you like to use? (8, 11, 17, 21): "
read -r jdk_version
case $jdk_version in
8)
msg_info "Installing Temurin JDK 8 (LTS) for Tomcat $TOMCAT_VERSION"
export DEBIAN_FRONTEND=noninteractive apt-get install -y temurin-8-jdk
export DEBIAN_FRONTEND=noninteractive
apt-get install -y temurin-8-jdk
msg_ok "Setup Temurin JDK 8 (LTS)"
;;
11)
@ -63,7 +64,7 @@ case $version in
;;
esac
;;
10|10.1)
10 | 10.1)
TOMCAT_VERSION="10"
echo "Which LTS Java version would you like to use? (11, 17): "
read -r jdk_version
@ -92,7 +93,7 @@ case $version in
;;
esac
;;
11)
11)
TOMCAT_VERSION="11"
echo "Which LTS Java version would you like to use? (17, 21): "
read -r jdk_version
@ -115,7 +116,7 @@ case $version in
;;
esac
;;
*)
*)
msg_error "Invalid Tomcat version selected. Please enter 9, 10.1 or 11."
exit 1
;;
@ -129,7 +130,7 @@ mkdir -p /opt/tomcat-$TOMCAT_VERSION
tar --strip-components=1 -xzf /tmp/tomcat.tar.gz -C /opt/tomcat-$TOMCAT_VERSION
chown -R root:root /opt/tomcat-$TOMCAT_VERSION
cat <<EOF > /etc/systemd/system/tomcat.service
cat <<EOF >/etc/systemd/system/tomcat.service
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target