post_install_v2.sh hinzugefügt
This commit is contained in:
99
post_install_v2.sh
Normal file
99
post_install_v2.sh
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# =====================================================
|
||||||
|
# POST-INSTALL TOOLBOX (dialog GUI-Version)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Prüfen, ob Root
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
echo "Bitte als Root ausführen (sudo)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Skripte (Name -> URL)
|
||||||
|
declare -A SCRIPTS
|
||||||
|
SCRIPTS["Get Host & SSD Serialnumbers"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/get_sn.sh"
|
||||||
|
SCRIPTS["Setup Mail Notification"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/setup-email.sh"
|
||||||
|
SCRIPTS["Set CPU Scaling Governor"]="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/scaling-governor.sh"
|
||||||
|
SCRIPTS["Intel e1000e Offload Fix"]="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/nic-offloading-fix.sh"
|
||||||
|
SCRIPTS["Set PVE Update Repos"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/set_pve_repos.sh"
|
||||||
|
SCRIPTS["Set PBS Update Repos"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/set_pbs_repos.sh"
|
||||||
|
SCRIPTS["Create PVE MGNT Bridge"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/create_pve-mgnt-vmbr.sh"
|
||||||
|
SCRIPTS["Create PVE MGNT LXC"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/create_pve-mgnt-lxc.sh"
|
||||||
|
SCRIPTS["Install pcvisit RemoteHost on Windows VMs"]="https://me-gitea.maieredv.cloud/manuel.maier/pve-pbs-setup/raw/branch/main/install-pcvisit-remotehost.sh"
|
||||||
|
|
||||||
|
# Reihenfolge festlegen
|
||||||
|
ORDER=(
|
||||||
|
"Get Host & SSD Serialnumbers"
|
||||||
|
"Setup Mail Notification"
|
||||||
|
"Set CPU Scaling Governor"
|
||||||
|
"Intel e1000e Offload Fix"
|
||||||
|
"Set PVE Update Repos"
|
||||||
|
"Set PBS Update Repos"
|
||||||
|
"Create PVE MGNT Bridge"
|
||||||
|
"Create PVE MGNT LXC"
|
||||||
|
"Install pcvisit RemoteHost on Windows VMs"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Prüfen, ob dialog installiert ist
|
||||||
|
if ! command -v dialog &>/dev/null; then
|
||||||
|
echo "Dialog nicht gefunden. Installiere..."
|
||||||
|
apt update && apt install -y dialog
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Funktion für Menü
|
||||||
|
run_menu() {
|
||||||
|
local OPTIONS=()
|
||||||
|
local i=1
|
||||||
|
for key in "${ORDER[@]}"; do
|
||||||
|
OPTIONS+=("$i" "$key")
|
||||||
|
((i++))
|
||||||
|
done
|
||||||
|
OPTIONS+=("0" "Beenden")
|
||||||
|
|
||||||
|
CHOICE=$(dialog --clear --title "POST-INSTALL TOOLBOX" \
|
||||||
|
--menu "Wähle ein Script zum Ausführen:" 20 70 12 \
|
||||||
|
"${OPTIONS[@]}" 2>&1 >/dev/tty)
|
||||||
|
|
||||||
|
echo "$CHOICE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Hauptloop
|
||||||
|
while true; do
|
||||||
|
CHOICE=$(run_menu)
|
||||||
|
|
||||||
|
# Prüfen ob Abbrechen / Exit
|
||||||
|
if [ -z "$CHOICE" ] || [ "$CHOICE" == "0" ]; then
|
||||||
|
clear
|
||||||
|
echo "Bye! 👋"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Auswahl validieren
|
||||||
|
if [[ "$CHOICE" =~ ^[0-9]+$ ]] && [ "$CHOICE" -ge 1 ] && [ "$CHOICE" -le ${#ORDER[@]} ]; then
|
||||||
|
key="${ORDER[$CHOICE-1]}"
|
||||||
|
url="${SCRIPTS[$key]}"
|
||||||
|
|
||||||
|
dialog --infobox "Lade Script:\n$key\nVon: $url" 5 60
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
curl -sSL "$url" -o "$tmpfile"
|
||||||
|
|
||||||
|
if [ ! -s "$tmpfile" ]; then
|
||||||
|
dialog --msgbox "Fehler beim Download!" 5 40
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Unter-Script in Subshell ausführen
|
||||||
|
clear
|
||||||
|
echo "========================================"
|
||||||
|
echo "Starte Script: $key"
|
||||||
|
echo "========================================"
|
||||||
|
bash "$tmpfile"
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
|
||||||
|
echo
|
||||||
|
read -rp "Fertig! Enter drücken für Menü..." _
|
||||||
|
else
|
||||||
|
dialog --msgbox "Ungültige Auswahl! Bitte erneut versuchen." 5 50
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user