2014-08-07 02:57:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2020-11-17 23:49:06 +01:00
|
|
|
# Import common cmd
|
|
|
|
source ./experimental_helper.sh
|
|
|
|
source ./_common.sh
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-04-26 23:35:14 +02:00
|
|
|
seafile_version="$(ynh_app_upstream_version)"
|
2024-04-12 22:19:27 +02:00
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_script_progression --message="Stoping services..."
|
|
|
|
|
|
|
|
# Stop all services
|
2024-04-26 21:55:00 +02:00
|
|
|
ynh_systemd_action --service_name=seafile --action=stop
|
|
|
|
ynh_systemd_action --service_name=seahub --action=stop
|
2014-08-07 04:42:27 +02:00
|
|
|
|
2018-05-08 10:12:58 +02:00
|
|
|
# Force to kill all process in case of a process is not stoped cleanly
|
|
|
|
pkill -f seafile-controller || true
|
|
|
|
pkill -f seaf-server || true
|
|
|
|
pkill -f ccnet-server || true
|
|
|
|
pkill -f seahub || true
|
|
|
|
|
2024-04-21 12:07:55 +02:00
|
|
|
if [ "$YNH_APP_PURGE" -eq 1 ]; then
|
|
|
|
ynh_script_progression --message="Removing logs..."
|
|
|
|
ynh_secure_remove --file=/var/log/"$app"
|
|
|
|
fi
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_script_progression --message="Removing code..."
|
2024-04-26 23:35:14 +02:00
|
|
|
ynh_secure_remove --file=/var/www/"$app"
|
|
|
|
ynh_secure_remove --file=/opt/yunohost/"$app"
|
2015-02-10 14:42:32 +01:00
|
|
|
|
|
|
|
# Remove databases
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_script_progression --message="Removing databases..."
|
2023-09-27 19:26:58 +02:00
|
|
|
db_helper=ynh_"mysql"_remove_db
|
|
|
|
$db_helper --db_name ccnetdb --db_user seafile
|
|
|
|
$db_helper --db_name seahubdb --db_user seafile
|
2019-06-11 22:28:26 +02:00
|
|
|
|
|
|
|
# Remove systemd service
|
|
|
|
ynh_script_progression --message="Removing systemd units..."
|
2024-04-26 21:55:00 +02:00
|
|
|
ynh_remove_systemd_config --service=seafile
|
|
|
|
ynh_remove_systemd_config --service=seahub
|
2017-07-21 14:56:41 +02:00
|
|
|
|
2019-06-11 22:28:26 +02:00
|
|
|
# Remove nginx config
|
2019-09-10 22:50:07 +02:00
|
|
|
ynh_script_progression --message="Removing nginx configuration..."
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_remove_nginx_config
|
2017-07-21 14:56:41 +02:00
|
|
|
|
|
|
|
# Remove logrotate
|
|
|
|
ynh_remove_logrotate
|
2014-08-13 03:21:47 +02:00
|
|
|
|
2019-06-11 22:28:26 +02:00
|
|
|
# Remove the dedicated fail2ban config
|
2019-09-10 22:50:07 +02:00
|
|
|
ynh_script_progression --message="Removing fail2ban configuration..."
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2019-09-10 22:50:07 +02:00
|
|
|
ynh_script_progression --message="Removing seafile service..."
|
2019-06-11 22:28:26 +02:00
|
|
|
yunohost service remove seafile
|
|
|
|
yunohost service remove seahub
|
2015-03-17 01:15:44 +01:00
|
|
|
|
2019-06-11 22:28:26 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|
2020-11-29 17:29:51 +01:00
|
|
|
sleep 1
|