To keep things simple don't treat the default domain name as a special snowflake
This commit is contained in:
parent
17623bd26b
commit
6183b8dfde
|
@ -112,21 +112,17 @@ function remove_mailpile {
|
|||
rm /etc/systemd/system/mailpile.service
|
||||
|
||||
read_config_param "MAILPILE_DOMAIN_NAME"
|
||||
if [[ "$MAILPILE_DOMAIN_NAME" != "$DEFAULT_DOMAIN_NAME" ]]; then
|
||||
nginx_dissite $MAILPILE_DOMAIN_NAME
|
||||
remove_certs ${MAILPILE_DOMAIN_NAME}
|
||||
if [ -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME ]; then
|
||||
rm -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME
|
||||
fi
|
||||
if [ -d /var/www/$MAILPILE_DOMAIN_NAME ]; then
|
||||
rm -rf /var/www/$MAILPILE_DOMAIN_NAME
|
||||
fi
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $MAILPILE_DOMAIN_NAME
|
||||
deluser --remove-all-files mailpile
|
||||
else
|
||||
deluser mailpile
|
||||
nginx_dissite $MAILPILE_DOMAIN_NAME
|
||||
remove_certs ${MAILPILE_DOMAIN_NAME}
|
||||
if [ -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME ]; then
|
||||
rm -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME
|
||||
fi
|
||||
if [ -d /var/www/$MAILPILE_DOMAIN_NAME ]; then
|
||||
rm -rf /var/www/$MAILPILE_DOMAIN_NAME
|
||||
fi
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $MAILPILE_DOMAIN_NAME
|
||||
deluser --remove-all-files mailpile
|
||||
|
||||
remove_config_param MAILPILE_DOMAIN_NAME
|
||||
remove_config_param MAILPILE_CODE
|
||||
|
@ -179,12 +175,6 @@ function install_mailpile {
|
|||
# create folders and tags
|
||||
su -c "cd /var/www/$MAILPILE_DOMAIN_NAME/htdocs && ./mp --setup" - mailpile
|
||||
|
||||
if [[ $ONION_ONLY == 'no' ]]; then
|
||||
if [[ "$MAILPILE_DOMAIN_NAME" == "$DEFAULT_DOMAIN_NAME" ]]; then
|
||||
su -c "cd /var/www/$MAILPILE_DOMAIN_NAME/htdocs && ./mp set sys.http_path /mail" - mailpile
|
||||
fi
|
||||
fi
|
||||
|
||||
echo '[Unit]' > /etc/systemd/system/mailpile.service
|
||||
echo 'Description=Mailpile Email Client' >> /etc/systemd/system/mailpile.service
|
||||
echo 'After=syslog.target network.target nginx.target' >> /etc/systemd/system/mailpile.service
|
||||
|
@ -262,11 +252,7 @@ function install_mailpile {
|
|||
fi
|
||||
|
||||
function_check create_site_certificate
|
||||
if [[ "$MAILPILE_DOMAIN_NAME" == "$DEFAULT_DOMAIN_NAME" ]]; then
|
||||
if [ ! -f /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem ]; then
|
||||
create_site_certificate $MAILPILE_DOMAIN_NAME 'yes'
|
||||
fi
|
||||
else
|
||||
if [ ! -f /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem ]; then
|
||||
create_site_certificate $MAILPILE_DOMAIN_NAME 'yes'
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue