#!/bin/bash set -u # treat unset variables as an error #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get mattermost domain) db_name="mattermost" db_user="mmuser" final_path="/var/www/$app" data_path="/home/yunohost.app/$app" #================================================= # STANDARD REMOVE #================================================= # STOP AND REMOVE SERVICE #================================================= sudo supervisorctl stop "$app" sudo rm -f "/etc/supervisor/conf.d/${app}.conf" #================================================= # REMOVE THE MYSQL DATABASE #================================================= ynh_mysql_remove_db "$db_user" "$db_name" #================================================= # REMOVE APP MAIN DIR #================================================= ynh_secure_remove "$final_path" ynh_secure_remove "$data_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= ynh_remove_nginx_config #================================================= # REMOVE LOG FILE #================================================= sudo rm -f "/var/log/${app}.log" #================================================= # REMOVE DEDICATED USER #================================================= ynh_system_user_delete "$app"