Update package-rhel.sh

This commit is contained in:
JieXu 2025-08-18 09:29:38 +08:00 committed by GitHub
parent 75f61a80e5
commit a411d5b2ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
# Require Red Hat Enterprise Linux / Rocky Linux / AlmaLinux
# ===== Require Red Hat Enterprise Linux / Rocky Linux / AlmaLinux ======================
if [[ -r /etc/os-release ]]; then
. /etc/os-release
case "$ID" in
rhel|rocky|almalinux)
echo "[OK] Detected supported system: $NAME $VERSION_ID"
;;
*)
echo "[ERROR] Unsupported system: $NAME ($ID)."
echo "This script only supports Red Hat Enterprise Linux / Rocky Linux / AlmaLinux."
exit 1
;;
esac
else
echo "[ERROR] Cannot detect system (missing /etc/os-release)."
exit 1
fi
# ===== Config & Parse arguments =========================================================
VERSION_ARG="${1:-}" # Pass version number like 7.13.8, or leave empty
WITH_CORE="both" # Default: bundle both xray+sing-box