mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-07-16 05:49:49 +00:00
872f92d6b4
- Created dedicated `extras/java.sh` module for modular Temurin/Adoptium repository handling and isolated GPG key management. - Implemented selective JRE/JDK installation paths: Gaming (Minecraft) vs Development environments with version control selectors. - Enhanced user group membership logic (`_ensure_sudo_group`) to auto-configure administrative privileges on fresh installs. - Introduced maintenance-friendly passwordless sudo for `apt`, `systemctl`, and shutdown commands via `/etc/sudoers.d/`. - Added home directory ownership repair utility to fix root-owned files in user directories after improper `sudo` usage. - Enabled visual password feedback (`pwfeedback`) toggle for enhanced terminal usability during authentication prompts. - Refactored Debian 13/Trixie repository sourcing logic to ensure idempotency and prevent backports/duplicate sources conflicts. - Updated Bullseye legacy modules (extras.sh, repos.sh) to exclude deprecated packages (`hx`, `vscodium`) and enforce Firefox ESR defaults. - Cleaned repository configurations by removing obsolete `bullseye-updates` source entries to prevent dependency conflicts. - Implemented NVTOP conditional detection logic ensuring display only on active Nvidia drivers or supported architectures (Trixie/Bookworm). - Corrected `/modules/bullseye/extras.sh` menu mappings (Programming, Dev Tools) and verified package lists excluding incompatible tools (`hx`, `vscodium`). - Integrated ClamAV security module with daemon state management and background scan execution flows in all Security menus. - update README.md
63 lines
2.2 KiB
Bash
63 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
# java.sh — Adoptium Temurin repository setup and Java version selectors
|
|
# License GPL v3
|
|
|
|
_ensure_adoptium_repo() {
|
|
[ -f /etc/apt/sources.list.d/adoptium.list ] && return 0
|
|
|
|
local deps=()
|
|
! is_installed "wget" && deps+=("wget")
|
|
! is_installed "apt-transport-https" && deps+=("apt-transport-https")
|
|
! is_installed "gpg" && deps+=("gpg")
|
|
[ ${#deps[@]} -gt 0 ] && _run_install_batch "${deps[@]}"
|
|
|
|
wget -qO - "https://packages.adoptium.net/artifactory/api/gpg/key/public" \
|
|
| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/adoptium.gpg 2>/dev/null
|
|
|
|
local codename
|
|
codename=$(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release)
|
|
echo "deb https://packages.adoptium.net/artifactory/deb ${codename} main" \
|
|
| sudo tee /etc/apt/sources.list.d/adoptium.list > /dev/null
|
|
|
|
sudo apt update \
|
|
-o Dir::Etc::sourcelist=/etc/apt/sources.list.d/adoptium.list \
|
|
-o Dir::Etc::sourceparts="-" \
|
|
2>/dev/null || true
|
|
}
|
|
|
|
_install_gaming_java() {
|
|
local ver
|
|
ver=$(whiptail --title "Java Runtimes for Gaming" --menu \
|
|
"Select Java version:" 12 65 3 \
|
|
"8" "Java 8 — For classic mods & Minecraft <= 1.16.5" \
|
|
"17" "Java 17 — For Minecraft era 1.17 to 1.20.4" \
|
|
"21" "Java 21 — For modern Minecraft >= 1.20.5 & 1.21+" \
|
|
3>&1 1>&2 2>&3)
|
|
[ -z "$ver" ] && { echo "No Java version selected."; return; }
|
|
_ensure_adoptium_repo
|
|
_run_install "temurin-${ver}-jre"
|
|
}
|
|
|
|
_install_dev_java() {
|
|
local ver
|
|
ver=$(whiptail --title "Java Development Kits (JDK)" --menu \
|
|
"Select JDK version:" 12 60 3 \
|
|
"17" "Java 17 LTS Development Kit" \
|
|
"21" "Java 21 LTS Development Kit" \
|
|
"25" "Java 25 LTS Development Kit" \
|
|
3>&1 1>&2 2>&3)
|
|
[ -z "$ver" ] && { echo "No JDK version selected."; return; }
|
|
_ensure_adoptium_repo
|
|
_run_install "temurin-${ver}-jdk"
|
|
}
|
|
|
|
_any_jdk_installed_desc() {
|
|
local inst
|
|
inst=$(dpkg -l 'temurin-*-jdk' 2>/dev/null | awk '/^ii/ {print $2; exit}')
|
|
[ -n "$inst" ] && echo " ($inst installed)" || echo ""
|
|
}
|
|
|
|
_any_jdk_state() {
|
|
dpkg -l 'temurin-*-jdk' 2>/dev/null | grep -q '^ii' && echo "ON" || echo "OFF"
|
|
}
|