#!/bin/bash
# prerm script for imunify-core
set -e
case "$1" in
    purge|remove)
        /bin/systemctl stop imunify-agent-proxy.service > /dev/null 2>&1 || :
        /bin/systemctl stop imunify-agent-proxy.socket > /dev/null 2>&1 || :
        /bin/systemctl --no-reload disable imunify-agent-proxy.service > /dev/null 2>&1 || :
        /bin/systemctl --no-reload disable imunify-agent-proxy.socket > /dev/null 2>&1 || :
    ;;
    upgrade)
        /bin/systemctl stop imunify-agent-proxy.service > /dev/null 2>&1 || :
        /bin/systemctl stop imunify-agent-proxy.socket > /dev/null 2>&1 || :
    ;;
    failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;
    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac
exit 0
