mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
dd2a128e76
While we run yunohost firewall reload the monitorix rules (for stats) are remove. We add a hook to fix that
42 lines
1,006 B
Bash
Executable file
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
|