2015-10-21 13:03:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e # Exit on error
|
|
|
|
|
|
|
|
domain=$(sudo yunohost app setting mattermost domain)
|
|
|
|
db_name="mattermost"
|
|
|
|
db_user="mmuser"
|
|
|
|
db_root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
|
|
|
|
|
|
# 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
|
|
|
|
mysql -u root -p$db_root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
|
|
|
|
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
|
|
|
|
|