Create mailscanneruninstaller.sh

Creates uninstaller needed for #400
This commit is contained in:
WhatTheServer
2020-08-08 06:34:22 -04:00
committed by GitHub
parent bcd07163c4
commit 6f7af44a52

View File

@@ -0,0 +1,31 @@
#!/bin/bash
## Uninstall Mailscanner CyberPanel
if [ -f /etc/os-release ];then
OS=$(head -1 /etc/os-release)
UBUNTUVERSION=$(sed '6q;d' /etc/os-release)
CENTOSVERSION=$(sed '5q;d' /etc/os-release)
CLNVERSION=$(sed '3q;d' /etc/os-release)
fi
systemctl stop mailscanner
if [ "$OS" = "NAME=\"Ubuntu\"" ];then
apt purge -y mailscanner
elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then
yum remove -y MailScanner
elif [ "$OS" = "NAME=\"CloudLinux\"" ];then
yum remove -y MailScanner
fi
sed -i '/\/^Received:\/ HOLD/d' /etc/postfix/header_checks
rm -rf /etc/MailScanner
rm -rf /usr/share/MailScanner
rm -rf /usr/local/CyberCP/public/mailwatch
systemctl restart postfix dovecot