#!/usr/bin/env bash

PLUGIN_DIR='/var/cpanel/plugins/comet-backup'

/usr/bin/echo "Removing the Comet Backup configuration before an image snapshot"

( systemctl list-unit-files | grep "backup-tool" ) &&
   /usr/bin/echo "Stoping and disabling the server monitoring agent" &&
   /usr/bin/systemctl disable --now backup-tool

$PLUGIN_DIR/uninstall.sh || true;

exit 0
