#!/bin/bash
# (c) 2024 BotGuard OÜ info@botguard.net

KEEP_CONFIG=0
if [[ "$1" == "--keep-config" ]]; then
    KEEP_CONFIG=1
fi

export KEEP_CONFIG

echo "Uninstalling Blackwall Protection plugin..."

if command -v apt-get &> /dev/null; then
    apt-get remove -y blackwall-protection-whm
elif command -v yum &> /dev/null; then
    yum remove -y blackwall-protection-whm
elif command -v dnf &> /dev/null; then
    dnf remove -y blackwall-protection-whm
else
    echo "Error: No supported package manager found (apt-get, yum, or dnf)."
    exit 1
fi
