2014-08-07 02:57:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-12-27 10:44:40 +01:00
|
|
|
# Import common cmd
|
|
|
|
source ./_common.sh
|
|
|
|
|
2017-01-05 23:24:32 +01:00
|
|
|
# Init script
|
|
|
|
init_script
|
2016-12-27 10:44:40 +01:00
|
|
|
|
2017-01-05 23:24:32 +01:00
|
|
|
sudo service seafile-server stop || true
|
2014-08-07 04:42:27 +02:00
|
|
|
|
2015-03-18 18:07:50 +01:00
|
|
|
# remove sso config to unprotect domain.tld/seafhttp in /etc/ssowat/conf.json.persistent
|
2017-01-05 23:24:32 +01:00
|
|
|
test -e /var/www/$app/remove_sso_conf.py && sudo python /var/www/$app/remove_sso_conf.py
|
|
|
|
test -e /opt/yunohost/$app/remove_sso_conf.py && sudo python /opt/yunohost/$app/remove_sso_conf.py
|
|
|
|
sudo rm -rf /var/www/$app
|
|
|
|
sudo rm -rf /opt/yunohost/$app
|
2014-08-12 03:18:09 +02:00
|
|
|
sudo rm -f /etc/init.d/seafile-server
|
2015-02-10 14:42:32 +01:00
|
|
|
sudo rm -rf /home/yunohost.app/seafile-data
|
2017-01-05 23:24:32 +01:00
|
|
|
sudo rm -rf /tmp/seahub_cache
|
2015-02-10 14:42:32 +01:00
|
|
|
|
|
|
|
# Remove databases
|
2017-01-05 23:24:32 +01:00
|
|
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
|
|
mysql -u root -p$root_pwd -e "DROP DATABASE ccnetdb ; DROP DATABASE seafiledb ; DROP DATABASE seahubdb ; DROP USER seafile@localhost ;" || true
|
|
|
|
|
|
|
|
# Remove domain config
|
|
|
|
domain=$(ynh_app_setting_get seafile domain)
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/seafile.conf
|
2014-08-13 03:21:47 +02:00
|
|
|
|
2015-03-17 01:15:44 +01:00
|
|
|
sudo yunohost service remove seafile-server
|
|
|
|
|
2015-02-10 14:42:32 +01:00
|
|
|
# Restart services
|
|
|
|
sudo service nginx reload
|
|
|
|
sudo yunohost app ssowatconf
|