seafile_ynh/scripts/remove

50 lines
1.2 KiB
Text
Raw Normal View History

#!/bin/bash
2017-07-21 14:56:41 +02:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
set -u
# Import common cmd
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)
2017-07-21 14:56:41 +02:00
systemctl stop seafile-server.service
# remove sso config to unprotect domain.tld/seafhttp in /etc/ssowat/conf.json.persistent
2017-07-21 14:56:41 +02:00
test -e /var/www/$app/remove_sso_conf.py && python /var/www/$app/remove_sso_conf.py
test -e /opt/yunohost/$app/remove_sso_conf.py && python /opt/yunohost/$app/remove_sso_conf.py
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
2017-12-10 10:45:51 +01:00
ynh_secure_remove /var/log/seafile-server
# 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
2017-07-21 14:56:41 +02:00
yunohost service remove seafile-server
2017-07-21 14:56:41 +02:00
# Reload nginx
systemctl reload nginx.service