Function to remove webmail

This commit is contained in:
Bob Mottram 2016-07-04 19:14:03 +01:00
parent 8afe6548f9
commit df9468a1a4
1 changed files with 21 additions and 3 deletions

View File

@ -33,15 +33,33 @@ WEBMAIL_COMMIT='78cf9c2e5cff2d78cd8beb647d60570f195a2a9c'
WEBMAIL_ONION_HOSTNAME=
WEBMAIL_ONION_PORT=8097
WEBMAIL_ADMIN_PASSWORD=
WEB_PATH=/var/www
WEBMAIL_PATH=$WEB_PATH/webmail
function remove_webmail {
if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
return
fi
nginx_dissite webmail
if [ -f /etc/nginx/sites-available/webmail ]; then
rm /etc/nginx/sites-available/webmail
fi
function_check remove_onion_service
remove_onion_service webmail ${WEBMAIL_ONION_PORT}
function_check drop_database
drop_database webmain
if [ -d $WEB_PATH/webmail ]; then
rm -rf $WEB_PATH/webmail
fi
sed -i '/Webmail /d' $COMPLETION_FILE
sed -i '/install_webmail/d' $COMPLETION_FILE
}
function install_webmail {
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
WEB_PATH=/var/www
WEBMAIL_PATH=$WEB_PATH/webmail
# update to a new commit if needed
function_check set_repo_commit
set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO