1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00
sogo_ynh/scripts/remove
2016-05-22 04:29:09 +02:00

25 lines
638 B
Bash
Executable file

#!/bin/bash
app=sogo
# Retrieve arguments
domain=$(sudo yunohost app setting $app domain)
path=$(sudo yunohost app setting $app path)
admin=$(sudo yunohost app setting $app admin)
is_public=$(sudo yunohost app setting $app is_public)
# Remove configuration files
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
# If a database is used, remove it
root_pwd=$(sudo cat /etc/yunohost/mysql)
mysql -u root -p$root_pwd -e "DROP DATABASE $app ; DROP USER $app@localhost ;"
sudo rm /etc/apt/sources.list.d/sogo.list
sudo apt-get update
sudo apt-get remove sogo
# Restart services
sudo service nginx reload
sudo yunohost app ssowatconf