From 6bb4b539079b52244aa96d4f3a823f45e0cb4401 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sun, 12 Apr 2026 21:13:25 +0200 Subject: [PATCH] PMG Post Install: detect gateway via dpkg or PMG service units --- tools/pve/post-pmg-install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/pve/post-pmg-install.sh b/tools/pve/post-pmg-install.sh index 683e1475f..0b76e7add 100644 --- a/tools/pve/post-pmg-install.sh +++ b/tools/pve/post-pmg-install.sh @@ -47,9 +47,12 @@ msg_error() { source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pmg-install" "pve" -if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null && \ - ! grep -qE '^ID=(pmg|proxmox-mail-gateway)' /etc/os-release 2>/dev/null && \ - ! grep -qE '^PRETTY_NAME=.*Proxmox Mail Gateway' /etc/os-release 2>/dev/null; then +if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null && + ! grep -qE '^ID=(pmg|proxmox-mail-gateway)' /etc/os-release 2>/dev/null && + ! grep -qE '^PRETTY_NAME=.*Proxmox Mail Gateway' /etc/os-release 2>/dev/null && + ! dpkg -s proxmox-mailgateway-container >/dev/null 2>&1 && + ! dpkg -s proxmox-mailgateway >/dev/null 2>&1 && + ! systemctl list-unit-files 'pmg*.service' 2>/dev/null | grep -q '^pmg.*\.service'; then msg_error "This script is only intended for Proxmox Mail Gateway" exit 232 fi