2015-10-21 13:03:49 +02:00
|
|
|
#!/bin/bash
|
2017-02-04 19:14:21 +01:00
|
|
|
set -u # treat unset variables as an error
|
2015-10-21 13:03:49 +02:00
|
|
|
|
2017-02-04 19:20:51 +01:00
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Read configuration
|
|
|
|
domain=$(ynh_app_setting_get mattermost domain)
|
2015-10-21 13:03:49 +02:00
|
|
|
db_name="mattermost"
|
|
|
|
db_user="mmuser"
|
|
|
|
|
|
|
|
# Stop service
|
|
|
|
sudo supervisorctl stop mattermost
|
|
|
|
|
2015-10-31 16:51:08 +01:00
|
|
|
# Remove sources and data
|
2015-10-21 13:03:49 +02:00
|
|
|
sudo rm -rf /var/www/mattermost
|
2015-10-31 16:51:08 +01:00
|
|
|
sudo rm -rf /home/yunohost.app/mattermost
|
2015-10-21 13:03:49 +02:00
|
|
|
|
|
|
|
# Remove database
|
2017-02-04 19:20:51 +01:00
|
|
|
ynh_mysql_execute_as_root "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
2015-10-21 13:03:49 +02:00
|
|
|
|
2015-10-31 16:51:08 +01:00
|
|
|
# Remove uploaded files
|
|
|
|
|
2015-10-21 14:33:49 +02:00
|
|
|
# Delete SMTP user
|
|
|
|
sudo userdel mattermost
|
|
|
|
|
2015-10-21 13:03:49 +02:00
|
|
|
# Remove configuration files
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/mattermost.conf
|
|
|
|
sudo rm /etc/supervisor/conf.d/mattermost.conf
|
2015-10-21 14:33:49 +02:00
|
|
|
|
|
|
|
# Remove log files
|
|
|
|
sudo rm -f /var/log/mattermost.log
|