2017-01-05 23:37:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-31 16:07:43 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2019-06-07 23:09:30 +02:00
|
|
|
# Stop script if errors
|
|
|
|
set -u
|
|
|
|
|
2017-01-05 23:37:07 +01:00
|
|
|
# Import common cmd
|
2018-01-31 16:07:43 +01:00
|
|
|
source ./experimental_helper.sh
|
2017-01-05 23:37:07 +01:00
|
|
|
source ./_common.sh
|
|
|
|
|
2020-11-17 23:37:38 +01:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..."
|
|
|
|
|
|
|
|
|
2017-01-05 23:37:07 +01:00
|
|
|
# Retrieve app settings
|
2019-06-07 23:09:30 +02:00
|
|
|
domain=$(ynh_app_setting_get --app $app --key domain)
|
2017-01-05 23:37:07 +01:00
|
|
|
|
2018-01-31 16:07:43 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
2017-01-05 23:37:07 +01:00
|
|
|
# Stop service
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_script_progression --message="Stoping services..."
|
2017-07-21 22:11:45 +02:00
|
|
|
systemctl stop monitorix.service
|
2017-01-05 23:37:07 +01:00
|
|
|
|
|
|
|
# Drop MySQL database and user
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_script_progression --message="Removing databases..."
|
2017-01-05 23:37:07 +01:00
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
|
|
|
ynh_mysql_drop_db "$dbname" || true
|
|
|
|
ynh_mysql_drop_user "$dbuser" || true
|
|
|
|
|
2017-10-30 21:59:43 +01:00
|
|
|
# Remove data
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_script_progression --message="Removing logs..."
|
|
|
|
ynh_secure_remove --file=/var/lib/monitorix
|
2017-10-30 21:59:43 +01:00
|
|
|
|
2018-05-07 23:08:03 +02:00
|
|
|
# Remove nginx config
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_secure_remove --file="/etc/nginx/conf.d/monitorix_status.conf"
|
2018-05-07 23:08:03 +02:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
2017-01-05 23:37:07 +01:00
|
|
|
# Autoremove package
|
2019-06-07 23:09:30 +02:00
|
|
|
ynh_script_progression --message="Removing dependencies" --weight=10
|
2017-07-21 22:11:45 +02:00
|
|
|
ynh_remove_app_dependencies
|
2017-01-05 23:37:07 +01:00
|
|
|
ynh_package_autoremove monitorix
|
|
|
|
|
2017-07-21 22:11:45 +02:00
|
|
|
yunohost service remove monitorix
|
2019-06-07 23:09:30 +02:00
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|