2017-01-05 23:37:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-07-21 22:11:45 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Stop script if errors
|
|
|
|
set -u
|
|
|
|
|
2017-01-05 23:37:07 +01:00
|
|
|
# Import common cmd
|
|
|
|
source ./_common.sh
|
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Stop service
|
2017-07-21 22:11:45 +02:00
|
|
|
systemctl stop monitorix.service
|
2017-01-05 23:37:07 +01:00
|
|
|
|
2017-07-21 22:11:45 +02:00
|
|
|
# Suppression de la configuration nginx
|
|
|
|
ynh_secure_remove "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
systemctl reload nginx.service
|
2017-01-05 23:37:07 +01:00
|
|
|
|
|
|
|
# Drop MySQL database and user
|
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
|
|
|
ynh_mysql_drop_db "$dbname" || true
|
|
|
|
ynh_mysql_drop_user "$dbuser" || true
|
|
|
|
|
|
|
|
# Autoremove package
|
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
|