#!/bin/sh
#

# Tehama DIA  Linux Agent Removal Utility
#


if ! [ $(id -u) = 0 ]; then
   echo "This script must be run with root privilege"
   exit 1
fi


# stop and remove existing service
#
echo "Removing existing agent if present"
pkill sipagent

service avaceesip stop
systemctl stop avaceesip
systemctl disable avaceesip
systemctl daemon-reload
systemctl reset-failed

echo "Cleaning up DIA files if present"
rm -rf /usr/local/avacee
rm -rf /var/log/avacee
rm -rf /usr/local/avacee
