diff --git a/src/freedombone-app-webmail b/src/freedombone-app-webmail index 4d06ffb8..ff810888 100755 --- a/src/freedombone-app-webmail +++ b/src/freedombone-app-webmail @@ -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