mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-18 16:32:17 +00:00
Set default REPO_SOURCE to ProxmoxVE
Update hardcoded fallback REPO_SOURCE from ProxmoxVED to ProxmoxVE and clarify comment about production vs dev repository naming. Add fail-safe '|| true' to several detection pipelines (lspci for GPU and grep commands reading /proc/cpuinfo for CPU vendor/model) to avoid non-zero exits or empty outputs causing function failures and improve robustness.
This commit is contained in:
@@ -91,8 +91,8 @@ detect_repo_source() {
|
|||||||
community-scripts/ProxmoxVED) REPO_SOURCE="ProxmoxVED" ;;
|
community-scripts/ProxmoxVED) REPO_SOURCE="ProxmoxVED" ;;
|
||||||
"")
|
"")
|
||||||
# No URL detected — use hardcoded fallback
|
# No URL detected — use hardcoded fallback
|
||||||
# CI sed transforms this on promotion: ProxmoxVED → ProxmoxVE
|
# This value must match the repo: ProxmoxVE for production, ProxmoxVED for dev
|
||||||
REPO_SOURCE="ProxmoxVED"
|
REPO_SOURCE="ProxmoxVE"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Fork or unknown repo
|
# Fork or unknown repo
|
||||||
@@ -335,7 +335,7 @@ detect_gpu() {
|
|||||||
GPU_PASSTHROUGH="unknown"
|
GPU_PASSTHROUGH="unknown"
|
||||||
|
|
||||||
local gpu_line
|
local gpu_line
|
||||||
gpu_line=$(lspci 2>/dev/null | grep -iE "VGA|3D|Display" | head -1)
|
gpu_line=$(lspci 2>/dev/null | grep -iE "VGA|3D|Display" | head -1 || true)
|
||||||
|
|
||||||
if [[ -n "$gpu_line" ]]; then
|
if [[ -n "$gpu_line" ]]; then
|
||||||
# Extract model: everything after the colon, clean up
|
# Extract model: everything after the colon, clean up
|
||||||
@@ -374,7 +374,7 @@ detect_cpu() {
|
|||||||
|
|
||||||
if [[ -f /proc/cpuinfo ]]; then
|
if [[ -f /proc/cpuinfo ]]; then
|
||||||
local vendor_id
|
local vendor_id
|
||||||
vendor_id=$(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ')
|
vendor_id=$(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ' || true)
|
||||||
|
|
||||||
case "$vendor_id" in
|
case "$vendor_id" in
|
||||||
GenuineIntel) CPU_VENDOR="intel" ;;
|
GenuineIntel) CPU_VENDOR="intel" ;;
|
||||||
@@ -388,7 +388,7 @@ detect_cpu() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Extract model name and clean it up
|
# Extract model name and clean it up
|
||||||
CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ *//' | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/ */ /g' | cut -c1-64)
|
CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ *//' | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/ */ /g' | cut -c1-64 || true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export CPU_VENDOR CPU_MODEL
|
export CPU_VENDOR CPU_MODEL
|
||||||
|
|||||||
Reference in New Issue
Block a user