2014-08-07 02:57:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Stop script if errors
|
|
|
|
set -u
|
|
|
|
|
2016-12-27 10:44:40 +01:00
|
|
|
# Import common cmd
|
2018-02-11 01:20:58 +01:00
|
|
|
source ./experimental_helper.sh
|
2016-12-27 10:44:40 +01:00
|
|
|
source ./_common.sh
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Init get Final path
|
|
|
|
get_configuration
|
|
|
|
|
|
|
|
# Retrieve arguments
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2016-12-27 10:44:40 +01:00
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
systemctl stop seafile-server.service
|
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
|
2018-03-09 20:37:26 +01:00
|
|
|
test -e /var/www/$app/remove_sso_conf.py && python3 /var/www/$app/remove_sso_conf.py
|
|
|
|
test -e /opt/yunohost/$app/remove_sso_conf.py && python3 /opt/yunohost/$app/remove_sso_conf.py
|
2017-12-10 11:29:36 +01:00
|
|
|
ynh_secure_remove /var/log/seafile
|
2017-07-21 14:56:41 +02:00
|
|
|
ynh_secure_remove /var/www/$app
|
|
|
|
ynh_secure_remove /opt/yunohost/$app
|
|
|
|
ynh_secure_remove /etc/init.d/seafile-server
|
|
|
|
ynh_secure_remove /home/yunohost.app/seafile-data
|
|
|
|
ynh_secure_remove /tmp/seahub_cache
|
2015-02-10 14:42:32 +01:00
|
|
|
|
|
|
|
# Remove databases
|
2017-07-21 14:56:41 +02:00
|
|
|
ynh_mysql_drop_db ccnetdb
|
|
|
|
ynh_mysql_drop_db seafiledb
|
|
|
|
ynh_mysql_drop_db seahubdb
|
|
|
|
|
2017-12-10 10:45:51 +01:00
|
|
|
# Remove user
|
|
|
|
ynh_system_user_delete seafile
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Remove depandance
|
|
|
|
ynh_remove_app_dependencies
|
2017-01-05 23:24:32 +01:00
|
|
|
|
|
|
|
# Remove domain config
|
2017-07-21 14:56:41 +02:00
|
|
|
ynh_secure_remove /etc/nginx/conf.d/$domain.d/seafile.conf
|
|
|
|
|
|
|
|
# Remove logrotate
|
|
|
|
ynh_remove_logrotate
|
2014-08-13 03:21:47 +02:00
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
yunohost service remove seafile-server
|
2015-03-17 01:15:44 +01:00
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Reload nginx
|
|
|
|
systemctl reload nginx.service
|