1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00
monitorix_ynh/scripts/remove
2017-10-31 22:21:01 +01:00

35 lines
695 B
Bash
Executable file

#!/bin/bash
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
set -u
# Import common cmd
source ./_common.sh
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
# Stop service
systemctl stop monitorix.service
# Suppression de la configuration nginx
ynh_secure_remove "/etc/nginx/conf.d/$domain.d/$app.conf"
systemctl reload nginx.service
# Drop MySQL database and user
dbname=$app
dbuser=$app
ynh_mysql_drop_db "$dbname" || true
ynh_mysql_drop_user "$dbuser" || true
# Remove data
ynh_secure_remove /var/lib/monitorix
# Autoremove package
ynh_remove_app_dependencies
ynh_package_autoremove monitorix
yunohost service remove monitorix