mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-01 10:22:08 +00:00
Keep guest services off PBS hosts, refuse only known PBS in PVE scripts and follow the menu conventions
- On a PBS host the Monitor no longer starts the node metrics and VM prewarmers, the LXC update scheduler, the managed installs detector or the app update emitter, which read guests and PVE metrics that do not exist there - pmx_require_pve refuses only a host known to be PBS, so an unreadable package list leaves the PVE scripts working as before - The PBS menu numbers its options, shows the tables proxmox-backup-manager prints instead of raw JSON, and says Goodbye on exit - The PBS update asks to press Enter before returning - Spanish: Datastores de PBS
This commit is contained in:
@@ -8,8 +8,10 @@ pmx_is_pbs() {
|
||||
[[ "$(pmx_platform_field product)" == pbs ]]
|
||||
}
|
||||
|
||||
# Only a host known to be PBS is refused: if the package list cannot be read,
|
||||
# the PVE scripts keep working as they did before PBS support.
|
||||
pmx_require_pve() {
|
||||
if [[ "$(pmx_platform_field product)" != pve ]]; then
|
||||
if pmx_is_pbs; then
|
||||
msg_error "$(translate 'This operation requires a Proxmox VE host. Use the PBS menu on Proxmox Backup Server.')"
|
||||
return 1
|
||||
fi
|
||||
|
||||
+27
-20
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
# PBS exposes compatible host tools; PVE guest/repository optimizations stay in the PVE menu.
|
||||
# ==========================================================
|
||||
# ProxMenux - Proxmox Backup Server menu
|
||||
# ==========================================================
|
||||
# PBS exposes compatible host tools; PVE guest/repository optimizations
|
||||
# stay in the PVE menu.
|
||||
# ==========================================================
|
||||
BASE_DIR="/usr/local/share/proxmenux"
|
||||
LOCAL_SCRIPTS="$BASE_DIR/scripts"
|
||||
source "$BASE_DIR/utils.sh"
|
||||
@@ -13,34 +18,36 @@ if ! pmx_is_pbs; then
|
||||
fi
|
||||
|
||||
pbs_show() {
|
||||
local output
|
||||
local title="$1" output
|
||||
shift
|
||||
output=$(mktemp)
|
||||
if "$@" > "$output" 2>&1; then
|
||||
dialog --backtitle "ProxMenux · PBS" --title "Proxmox Backup Server" --textbox "$output" 24 100
|
||||
dialog --backtitle "ProxMenux" --title "$title" --textbox "$output" 24 110
|
||||
else
|
||||
dialog --backtitle "ProxMenux · PBS" --title "$(translate 'Command failed')" --textbox "$output" 24 100
|
||||
dialog --backtitle "ProxMenux" --title "$(translate 'Command failed')" --textbox "$output" 24 110
|
||||
fi
|
||||
rm -f "$output"
|
||||
}
|
||||
|
||||
while true; do
|
||||
choice=$(dialog --clear --backtitle "ProxMenux · PBS" --title "Proxmox Backup Server" \
|
||||
--menu "$(translate 'Select an option:')" 20 80 10 \
|
||||
status "$(translate 'PBS version and packages')" \
|
||||
stores "$(translate 'PBS datastores')" \
|
||||
tasks "$(translate 'Recent PBS tasks')" \
|
||||
utilities "$(translate 'System Utilities Installer')" \
|
||||
update "$(translate 'Update PBS using configured repositories')" \
|
||||
settings "$(translate 'Settings')" \
|
||||
exit "$(translate 'Exit')" 2>&1 >/dev/tty) || break
|
||||
choice=$(dialog --clear --backtitle "ProxMenux" --title "Proxmox Backup Server" \
|
||||
--menu "$(translate 'Select an option:')" 18 75 8 \
|
||||
1 "$(translate 'PBS version and packages')" \
|
||||
2 "$(translate 'PBS datastores')" \
|
||||
3 "$(translate 'Recent PBS tasks')" \
|
||||
4 "$(translate 'System Utilities Installer')" \
|
||||
5 "$(translate 'Update PBS using configured repositories')" \
|
||||
s "$(translate 'Settings')" \
|
||||
0 "$(translate 'Exit')" 2>&1 >/dev/tty) || break
|
||||
case "$choice" in
|
||||
status) pbs_show proxmox-backup-manager versions --verbose --output-format json-pretty ;;
|
||||
stores) pbs_show proxmox-backup-manager datastore list --output-format json-pretty ;;
|
||||
tasks) pbs_show proxmox-backup-manager task list --all true --limit 20 --output-format json-pretty ;;
|
||||
utilities) bash "$LOCAL_SCRIPTS/utilities/system_utils.sh" ;;
|
||||
update) bash "$LOCAL_SCRIPTS/utilities/pbs_update.sh" ;;
|
||||
settings) bash "$LOCAL_SCRIPTS/menus/config_menu.sh" ;;
|
||||
exit) break ;;
|
||||
1) pbs_show "$(translate 'PBS version and packages')" proxmox-backup-manager versions --verbose ;;
|
||||
2) pbs_show "$(translate 'PBS datastores')" proxmox-backup-manager datastore list ;;
|
||||
3) pbs_show "$(translate 'Recent PBS tasks')" proxmox-backup-manager task list --all true --limit 20 ;;
|
||||
4) bash "$LOCAL_SCRIPTS/utilities/system_utils.sh" ;;
|
||||
5) bash "$LOCAL_SCRIPTS/utilities/pbs_update.sh" ;;
|
||||
s) exec bash "$LOCAL_SCRIPTS/menus/config_menu.sh" ;;
|
||||
0) break ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
msg_ok "$(translate "Thank you for using ProxMenux. Goodbye!")"
|
||||
|
||||
@@ -12,27 +12,30 @@ if ! pmx_is_pbs || [[ "$(pmx_platform_field supported)" != true ]]; then
|
||||
exit 1
|
||||
fi
|
||||
[[ $EUID -eq 0 ]] || { msg_error "$(translate 'Run this operation as root.')"; exit 1; }
|
||||
dialog --backtitle "ProxMenux · PBS" --title "$(translate 'PBS package update')" \
|
||||
dialog --backtitle "ProxMenux" --title "$(translate 'PBS package update')" \
|
||||
--yesno "$(translate 'Refresh the configured APT repositories and review the PBS package upgrade? Repository files will be preserved.')" 10 80 || exit 0
|
||||
if ! apt-get -o APT::Update::Error-Mode=any update; then
|
||||
msg_error "$(translate 'APT refresh failed. Check the PBS subscription and repositories in the native PBS interface; no source was changed.')"
|
||||
read -r _
|
||||
msg_success "$(translate "Press Enter to continue...")"
|
||||
read -r
|
||||
exit 1
|
||||
fi
|
||||
plan=$(mktemp)
|
||||
trap 'rm -f "$plan"' EXIT
|
||||
if ! apt-get -s full-upgrade > "$plan" 2>&1; then
|
||||
dialog --textbox "$plan" 24 100
|
||||
dialog --backtitle "ProxMenux" --title "$(translate 'Review package upgrade')" --textbox "$plan" 24 100
|
||||
exit 1
|
||||
fi
|
||||
dialog --backtitle "ProxMenux · PBS" --title "$(translate 'Review package upgrade')" --textbox "$plan" 24 100
|
||||
dialog --defaultno --title "$(translate 'Apply PBS package upgrade')" \
|
||||
dialog --backtitle "ProxMenux" --title "$(translate 'Review package upgrade')" --textbox "$plan" 24 100
|
||||
dialog --backtitle "ProxMenux" --defaultno --title "$(translate 'Apply PBS package upgrade')" \
|
||||
--yesno "$(translate 'Apply the reviewed package upgrade now? Services may restart and packages listed for removal will be removed.')" 11 80 || exit 0
|
||||
if apt-get -y full-upgrade; then
|
||||
msg_ok "$(translate 'PBS package upgrade completed. Check whether a reboot is required before your next backup window.')"
|
||||
else
|
||||
msg_error "$(translate 'PBS package upgrade failed. Review the APT output before retrying.')"
|
||||
read -r _
|
||||
msg_success "$(translate "Press Enter to continue...")"
|
||||
read -r
|
||||
exit 1
|
||||
fi
|
||||
read -r _
|
||||
msg_success "$(translate "Press Enter to continue...")"
|
||||
read -r
|
||||
|
||||
Reference in New Issue
Block a user