SERVICES=("ananicy-cpp")

post_install() {
    echo "Enabling services..."
    for service in "${SERVICES[@]}"; do
        systemctl enable "$service"
    done
}

post_upgrade() {
    echo "Enabling services..."
    systemctl daemon-reload >/dev/null

    for service in "${SERVICES[@]}"; do
        if systemctl is-active "$service" >/dev/null; then
            systemctl restart "$service"
        else
            systemctl enable "$service"
        fi
    done
    if systemctl is-enabled uksmd >/dev/null; then
        echo "Disabling uksmd, managed now via systemd 256 MemoryKSM"
        systemctl disable uksmd
    fi
}
