Skip to content

Commit 503d3fe

Browse files
author
Kristan Kenney
committed
Fix functions in domain.sh
1 parent 32a75e6 commit 503d3fe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

func/domain.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,15 +634,25 @@ add_webmail_config() {
634634

635635
if [[ "$2" =~ stpl$ ]]; then
636636
rm -f /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf
637-
echo "include $conf;" > /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf
637+
if [ ! -z "$WEB_SYSTEM" ]; then
638+
ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf
639+
fi
640+
if [ ! -z "$PROXY_SYSTEM" ]; then
641+
ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf
642+
fi
638643

639644
# Clear old configurations
640645
rm -rf $HOMEDIR/$user/conf/mail/$domain.*
641646
rm -rf $HOMEDIR/$user/conf/mail/ssl.$domain.*
642647
rm -rf $HOMEDIR/$user/conf/mail/*nginx.$domain.*
643648
else
644649
rm -f /etc/$1/conf.d/domains/mail.$domain.conf
645-
echo "include $conf;" > /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf
650+
if [ ! -z "$WEB_SYSTEM" ]; then
651+
ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf
652+
fi
653+
if [ ! -z "$PROXY_SYSTEM" ]; then
654+
ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf
655+
fi
646656

647657
# Clear old configurations
648658
rm -rf $HOMEDIR/$user/conf/mail/$domain.*

0 commit comments

Comments
 (0)