update beta ProxMenux 1.2.1.1-beta

This commit is contained in:
MacRimi
2026-05-09 18:59:59 +02:00
parent 5ed1fc44fd
commit 2f919de9e3
125 changed files with 16506 additions and 2877 deletions
+18 -18
View File
@@ -1,30 +1,26 @@
#!/bin/bash
# ==========================================================
# ProxMenux - A menu-driven script for Proxmox VE management
# ProxMenux - Import Disk to VM (Passthrough)
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
# License : GPL-3.0
# https://github.com/MacRimi/ProxMenux/blob/main/LICENSE
# Version : 1.2
# Last Updated: 12/04/2026
# ==========================================================
# Description:
# This script allows users to assign physical disks to existing
# Proxmox virtual machines (VMs) through an interactive menu.
# - Detects the system disk and excludes it from selection.
# - Lists all available VMs for the user to choose from.
# - Identifies and displays unassigned physical disks.
# - Allows the user to select multiple disks and attach them to a VM.
# - Supports interface types: SATA, SCSI, VirtIO, and IDE.
# - Ensures that disks are not already assigned to active VMs.
# - Warns about disk sharing between multiple VMs to avoid data corruption.
# - Configures the selected disks for the VM and verifies the assignment.
# - Prefers persistent /dev/disk/by-id paths for assignment when available.
# Assigns physical disks to existing Proxmox VMs via an
# interactive menu. Uses persistent /dev/disk/by-id paths
# whenever available and blocks system / already-assigned disks.
#
# The goal of this script is to simplify the process of assigning
# physical disks to Proxmox VMs, reducing manual configurations
# and preventing potential errors.
# Features:
# - Detects and excludes the system disk.
# - Lists all VMs for selection.
# - Identifies unassigned physical disks.
# - Supports SATA, SCSI, VirtIO and IDE interfaces.
# - Warns about disk sharing between VMs to avoid corruption.
# - Verifies the assignment after attaching.
# ==========================================================
@@ -426,7 +422,11 @@ for i in "${!DISK_LIST[@]}"; do
IFS=$'\t' read -r _model _size <<< "${DISK_DESCRIPTIONS[$i]}"
INDEX=0
while qm config "$VMID" | grep -q "${INTERFACE}${INDEX}"; do
# Anchor the match: `^scsi1:` vs `^scsi1\d:`. The previous `grep -q
# "scsi1"` matched scsi10/scsi11/... and skipped over a genuinely-free
# scsi1 slot — the disk still got attached but a hole was left mid-
# range. Audit Tier 6 — `disk-passthrough.sh` slot search no anchored.
while qm config "$VMID" | grep -Eq "^${INTERFACE}${INDEX}:"; do
((INDEX++))
done
+13 -11
View File
@@ -1,22 +1,24 @@
#!/bin/bash
# ==========================================================
# ProxMenux - A menu-driven script for Proxmox VE management
# ProxMenux - Import Disk to LXC (Passthrough)
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
# License : GPL-3.0
# https://github.com/MacRimi/ProxMenux/blob/main/LICENSE
# Version : 1.3
# Last Updated: 07/04/2026
# ==========================================================
# Description:
# This script allows users to assign physical disks to existing
# Proxmox containers (CTs) through an interactive menu.
# - Detects the system disk and excludes it from selection.
# - Lists all available CTs for the user to choose from.
# - Identifies and displays unassigned physical disks.
# - Allows the user to select multiple disks and attach them to a CT.
# - Configures the selected disks for the CT and verifies the assignment.
# - Uses persistent device paths to avoid issues with device order changes.
# Assigns physical disks to existing Proxmox LXC containers
# via an interactive menu, using persistent device paths to
# avoid issues with device order changes.
#
# Features:
# - Detects and excludes the system disk.
# - Lists all containers for selection.
# - Identifies unassigned physical disks.
# - Configures the selected disks for the CT and verifies
# the assignment.
# ==========================================================
# Configuration ============================================
+22 -3
View File
@@ -714,14 +714,33 @@ main() {
if [[ "$OPERATION_MODE" == "clean_sigs" ]]; then
msg_info "$(translate "Removing filesystem signatures...")"
wipefs -af "$SELECTED_DISK" >/dev/null 2>&1 || true
# `|| true` swallowed real failures (busy device, ENOSPC writing
# the magic bytes) and the user got a green "Signatures removed"
# even when nothing was actually wiped. Capture the failure and
# continue but report it. Audit Tier 6 — `format-disk.sh` wipefs
# `|| true` silencia fallos.
local _wipefs_errs=0
local _wipefs_err_out
if ! _wipefs_err_out=$(wipefs -af "$SELECTED_DISK" 2>&1); then
_wipefs_errs=$((_wipefs_errs + 1))
msg_warn "$(translate "wipefs failed on") $SELECTED_DISK: $_wipefs_err_out"
fi
local pname
while read -r pname; do
[[ -z "$pname" ]] && continue
[[ "/dev/$pname" == "$SELECTED_DISK" ]] && continue
[[ -b "/dev/$pname" ]] && wipefs -af "/dev/$pname" >/dev/null 2>&1 || true
if [[ -b "/dev/$pname" ]]; then
if ! _wipefs_err_out=$(wipefs -af "/dev/$pname" 2>&1); then
_wipefs_errs=$((_wipefs_errs + 1))
msg_warn "$(translate "wipefs failed on") /dev/$pname: $_wipefs_err_out"
fi
fi
done < <(lsblk -ln -o NAME "$SELECTED_DISK" 2>/dev/null | tail -n +2)
msg_ok "$(translate "Signatures removed. Partition table preserved.")"
if (( _wipefs_errs == 0 )); then
msg_ok "$(translate "Signatures removed. Partition table preserved.")"
else
msg_warn "$(translate "Some signatures could not be removed (see warnings above).")"
fi
echo
msg_success "$(translate "Disk is ready for VM passthrough.")"
echo
+17 -8
View File
@@ -1,19 +1,19 @@
#!/bin/bash
# ==========================================================
# ProxMenux - A menu-driven script for Proxmox VE management
# ProxMenux - Import Disk Image to VM
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
# License : GPL-3.0
# https://github.com/MacRimi/ProxMenux/blob/main/LICENSE
# Version : 1.3
# Last Updated: 12/04/2026
# ==========================================================
# Description:
# Imports disk images (.img, .qcow2, .vmdk, .raw) into Proxmox VE VMs.
# Supports the default system ISO directory and custom paths.
# All user decisions are collected in Phase 1 (dialogs) before
# any operation is executed in Phase 2 (terminal output).
# Imports disk images (.img, .qcow2, .vmdk, .raw) into
# existing Proxmox VE VMs. Supports the default ISO directory
# and custom paths; all user decisions are collected up-front
# (Phase 1 dialogs) before any operation runs (Phase 2).
# ==========================================================
# Configuration ============================================
@@ -163,7 +163,13 @@ while IFS= read -r img; do
IMAGE_OPTIONS+=("$img" "" "OFF")
done <<< "$IMAGES"
# `--separate-output` prints each selected tag on its own line with no
# quoting, so we never need `eval` to split the output. The previous form
# `eval "declare -a A=($SELECTED)"` would execute backticks / $(...) baked
# into a filename — perfectly legal on ext4 — as shell commands. Audit
# Tier 6 — `import-disk-image.sh` `eval` sobre salida del dialog.
SELECTED_IMAGES_STR=$(dialog --backtitle "$BACKTITLE" \
--separate-output \
--title "$(translate 'Select Disk Images')" \
--checklist "$(translate 'Select one or more disk images to import:')" \
$UI_MENU_H $UI_MENU_W $UI_MENU_LIST_H \
@@ -171,7 +177,10 @@ SELECTED_IMAGES_STR=$(dialog --backtitle "$BACKTITLE" \
2>&1 >/dev/tty)
[[ -z "$SELECTED_IMAGES_STR" ]] && exit 0
eval "declare -a SELECTED_ARRAY=($SELECTED_IMAGES_STR)"
declare -a SELECTED_ARRAY=()
while IFS= read -r _img; do
[[ -n "$_img" ]] && SELECTED_ARRAY+=("$_img")
done <<< "$SELECTED_IMAGES_STR"
# ── Step 5: Per-image options ─────────────────────────────
+4 -2
View File
@@ -416,8 +416,10 @@ while true; do
# ── Auto-export JSON (except long — handled by background monitor)
if [[ "$ACTION" != "long" && "$ACTION" != "report" ]]; then
# Determine test type from ACTION (short test or status check)
local json_test_type="short"
# Determine test type from ACTION (short test or status check).
# NOTE: no 'local' here — this block runs inside the top-level while loop,
# not inside a function, so 'local' would print a bash warning at runtime.
json_test_type="short"
[[ "$ACTION" == "status" ]] && json_test_type="status"
JSON_PATH=$(_smart_json_path "$SELECTED_DISK" "$json_test_type")