mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
27 lines
614 B
Bash
Executable file
27 lines
614 B
Bash
Executable file
#!/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
|
|
|
|
# Remove sources
|
|
sudo rm -rf /var/www/mattermost
|
|
|
|
# Remove database
|
|
mysql -u root -p$db_root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
|
|
|
# Delete SMTP user
|
|
sudo userdel mattermost
|
|
|
|
# Remove configuration files
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/mattermost.conf
|
|
sudo rm /etc/supervisor/conf.d/mattermost.conf
|
|
|
|
# Remove log files
|
|
sudo rm -f /var/log/mattermost.log
|
|
|