seafile_ynh/scripts/remove
Josué 86de26ec2d first commit
Former-commit-id: f532ecd7b6
2015-08-24 20:45:36 +02:00

22 lines
No EOL
715 B
Bash

#!/bin/bash
domain=$(sudo yunohost app setting seafile domain)
root_pwd=$(sudo cat /etc/yunohost/mysql)
sudo service seafile-server stop
# remove sso config to unprotect domain.tld/seafhttp in /etc/ssowat/conf.json.persistent
sudo python /var/www/seafile/remove_sso_conf.py
sudo rm -rf /var/www/seafile
sudo rm -f /etc/nginx/conf.d/$domain.d/seafile.conf
sudo rm -f /etc/init.d/seafile-server
sudo rm -rf /home/yunohost.app/seafile-data
# Remove databases
mysql -u root -p$root_pwd -e "DROP DATABASE ccnetdb ; DROP DATABASE seafiledb ; DROP DATABASE seahubdb ; DROP USER seafile@localhost ;"
sudo yunohost service remove seafile-server
# Restart services
sudo service nginx reload
sudo yunohost app ssowatconf