forked from unimatrix/web
Add Hetzner Debian Java 21 bootstrap and named network systemd services
This commit is contained in:
parent
865725026f
commit
1ed02dde8d
1 changed files with 28 additions and 0 deletions
28
network/hetzner-debian-setup.sh
Normal file
28
network/hetzner-debian-setup.sh
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
# Run as root on a fresh Debian 12/13 Hetzner Cloud VM.
|
||||
if [[ $EUID -ne 0 ]]; then echo "Run with sudo"; exit 1; fi
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get -y full-upgrade
|
||||
apt-get install -y ca-certificates curl wget unzip python3 tar jq ufw openssl
|
||||
if ! apt-cache show openjdk-21-jre-headless >/dev/null 2>&1; then
|
||||
apt-get install -y gnupg
|
||||
install -d -m 0755 /etc/apt/keyrings
|
||||
curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor -o /etc/apt/keyrings/adoptium.gpg
|
||||
. /etc/os-release
|
||||
echo "deb [signed-by=/etc/apt/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb ${VERSION_CODENAME} main" >/etc/apt/sources.list.d/adoptium.list
|
||||
apt-get update
|
||||
apt-get install -y temurin-21-jre
|
||||
else
|
||||
apt-get install -y openjdk-21-jre-headless
|
||||
fi
|
||||
java -version
|
||||
id dune >/dev/null 2>&1 || useradd --system --home-dir /opt/dunerealms --create-home --shell /usr/sbin/nologin dune
|
||||
install -d -o dune -g dune /opt/dunerealms
|
||||
cat >/etc/sysctl.d/90-dunerealms.conf <<'EOF'
|
||||
vm.swappiness=10
|
||||
EOF
|
||||
sysctl --system >/dev/null
|
||||
echo "Debian updated and Java 21 installed."
|
||||
echo "Next: copy the GitHub Actions DuneRealms-Velocity-Network.zip to /opt/dunerealms and run deploy-network.sh."
|
||||
Loading…
Reference in a new issue

Staff