From 7d47629e0b70f07e2203fd38cfb61df59e9d2279 Mon Sep 17 00:00:00 2001 From: RomanNum3ral Date: Fri, 3 Apr 2026 20:08:17 +0000 Subject: [PATCH] Update arch_install.sh --- arch_install.sh | 126 +++++++++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 50 deletions(-) diff --git a/arch_install.sh b/arch_install.sh index a9cae06..ba88ca4 100644 --- a/arch_install.sh +++ b/arch_install.sh @@ -1,69 +1,95 @@ #!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' -set -e +echo "============================================================" +echo "[INFO] Installing Jellyfin on Arch Linux (native, no Docker)" +echo "============================================================" -echo "========================================" -echo "[INFO] Installing Jellyfin (Arch Linux)" -echo "========================================" +# Require root or sudo +if [[ "${EUID}" -ne 0 ]]; then + SUDO="sudo" +else + SUDO="" +fi -# Update system -sudo pacman -Syu --noconfirm +echo "============================================================" +echo "[INFO] Updating package database and system" +echo "============================================================" +$SUDO pacman -Syu --noconfirm -# Install Jellyfin + dependencies -sudo pacman -S --noconfirm jellyfin ffmpeg +echo "============================================================" +echo "[INFO] Installing Jellyfin packages" +echo "============================================================" +$SUDO pacman -S --noconfirm jellyfin-server jellyfin-web jellyfin-ffmpeg -echo "========================================" -echo "[INFO] Creating directories" -echo "========================================" +echo "============================================================" +echo "[INFO] Creating media directories" +echo "============================================================" +$SUDO mkdir -p /srv/media/movies +$SUDO mkdir -p /srv/media/tv +$SUDO mkdir -p /srv/media/music +$SUDO mkdir -p /srv/jellyfin/cache +$SUDO mkdir -p /srv/jellyfin/config -# Create media directories -sudo mkdir -p /srv/jellyfin/{config,cache,media} -sudo mkdir -p /srv/jellyfin/media/{movies,tv,music} +echo "============================================================" +echo "[INFO] Setting ownership" +echo "============================================================" +$SUDO chown -R jellyfin:jellyfin /srv/media +$SUDO chown -R jellyfin:jellyfin /srv/jellyfin -# Set ownership -sudo chown -R jellyfin:jellyfin /srv/jellyfin - -echo "========================================" -echo "[INFO] Configuring Jellyfin directories" -echo "========================================" - -# Override default paths with systemd drop-in -sudo mkdir -p /etc/systemd/system/jellyfin.service.d - -sudo tee /etc/systemd/system/jellyfin.service.d/override.conf > /dev/null < /dev/null <<'EOF' [Service] Environment="JELLYFIN_DATA_DIR=/srv/jellyfin/config" Environment="JELLYFIN_CACHE_DIR=/srv/jellyfin/cache" EOF -echo "========================================" -echo "[INFO] Enabling and starting Jellyfin" -echo "========================================" - -sudo systemctl daemon-reexec -sudo systemctl daemon-reload -sudo systemctl enable jellyfin -sudo systemctl start jellyfin - -echo "========================================" -echo "[INFO] Configuring firewall (UFW if installed)" -echo "========================================" +echo "============================================================" +echo "[INFO] Reloading systemd and enabling Jellyfin" +echo "============================================================" +$SUDO systemctl daemon-reload +$SUDO systemctl enable --now jellyfin +echo "============================================================" +echo "[INFO] Opening firewall ports if UFW is installed" +echo "============================================================" if command -v ufw >/dev/null 2>&1; then - sudo ufw allow 8096/tcp - sudo ufw allow 8920/tcp - sudo ufw reload + $SUDO ufw allow 8096/tcp + $SUDO ufw allow 8920/tcp + $SUDO ufw reload fi -echo "========================================" -echo "[SUCCESS] Jellyfin is installed!" -echo "========================================" +echo "============================================================" +echo "[INFO] Checking Jellyfin service status" +echo "============================================================" +$SUDO systemctl --no-pager --full status jellyfin || true -IP=$(hostname -I | awk '{print $1}') +IP="$(hostname -I 2>/dev/null | awk '{print $1}')" -echo "Access Jellyfin at:" -echo " http://$IP:8096" -echo "" -echo "Default directories:" -echo " Config: /srv/jellyfin/config" -echo " Media: /srv/jellyfin/media" \ No newline at end of file +echo "============================================================" +echo "[SUCCESS] Jellyfin installation complete" +echo "============================================================" +if [[ -n "${IP:-}" ]]; then + echo "Open Jellyfin at:" + echo " http://${IP}:8096" +else + echo "Open Jellyfin at:" + echo " http://YOUR_SERVER_IP:8096" +fi +echo +echo "Media directories:" +echo " /srv/media/movies" +echo " /srv/media/tv" +echo " /srv/media/music" +echo +echo "Jellyfin config/cache:" +echo " /srv/jellyfin/config" +echo " /srv/jellyfin/cache" +echo +echo "Useful commands:" +echo " systemctl status jellyfin" +echo " journalctl -u jellyfin -e --no-pager" \ No newline at end of file