Skip to content

Commit ff94c5e

Browse files
author
Istiak Ferdous
authored
soft remove mail stack (#3497)
1 parent 7cccc31 commit ff94c5e

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

install/upgrade/manual/migrate_apache.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ ! -z "$WEB_BACKEND" ]; then
2222
fi
2323

2424
if [ "$(multiphp_count)" -gt 1 ]; then
25-
check_result $E_EXISTS "Multiphp allready enabled" > /dev/null
25+
check_result $E_EXISTS "Multiphp already enabled" > /dev/null
2626
fi
2727

2828
#----------------------------------------------------------#
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
# Function Description
4+
# Soft remove the mail stack
5+
6+
#----------------------------------------------------------#
7+
# Variable&Function #
8+
#----------------------------------------------------------#
9+
10+
# Includes
11+
# shellcheck source=/etc/hestiacp/hestia.conf
12+
source /etc/hestiacp/hestia.conf
13+
# shellcheck source=/usr/local/hestia/func/main.sh
14+
source $HESTIA/func/main.sh
15+
# shellcheck source=/usr/local/hestia/conf/hestia.conf
16+
source $HESTIA/conf/hestia.conf
17+
18+
#----------------------------------------------------------#
19+
# Verifications #
20+
#----------------------------------------------------------#
21+
22+
echo "This will soft remove the mail stack from HestiaCP and disable related systemd service."
23+
echo "You won't be able to access mail related configurations from HestiaCP."
24+
echo "Your existing mail data and apt packages will be kept back."
25+
read -p 'Would you like to continue? [y/n]'
26+
27+
#----------------------------------------------------------#
28+
# Action #
29+
#----------------------------------------------------------#
30+
31+
if [ "$ANTISPAM_SYSTEM" == "spamassassin" ]; then
32+
echo Removing Spamassassin
33+
sed -i "/^ANTISPAM_SYSTEM/d" $HESTIA/conf/hestia.conf
34+
systemctl disable --now spamassassin
35+
fi
36+
37+
if [ "$ANTIVIRUS_SYSTEM" == "clamav-daemon" ]; then
38+
echo Removing ClamAV
39+
sed -i "/^ANTIVIRUS_SYSTEM/d" $HESTIA/conf/hestia.conf
40+
systemctl disable --now clamav-daemon clamav-freshclam
41+
fi
42+
43+
if [ "$IMAP_SYSTEM" == "dovecot" ]; then
44+
echo Removing Dovecot
45+
sed -i "/^IMAP_SYSTEM/d" $HESTIA/conf/hestia.conf
46+
systemctl disable --now dovecot
47+
fi
48+
49+
if [ "$MAIL_SYSTEM" == "exim4" ]; then
50+
echo Removing Exim4
51+
sed -i "/^MAIL_SYSTEM/d" $HESTIA/conf/hestia.conf
52+
systemctl disable --now exim4
53+
fi

0 commit comments

Comments
 (0)