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
Josué Tille dd2a128e76 Force add iptables rule for monitorix
While we run yunohost firewall reload the monitorix rules (for stats) are remove. We add a hook to fix that
2018-05-01 12:42:19 +02:00

42 lines
1,006 B
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Import common cmd
source ./experimental_helper.sh
source ./_common.sh
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
#=================================================
# STANDARD REMOVE
#=================================================
# 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
ynh_secure_remove /usr/share/yunohost/hooks/post_iptable_rules/50-$app
# Autoremove package
ynh_remove_app_dependencies
ynh_package_autoremove monitorix
yunohost service remove monitorix