1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00

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
This commit is contained in:
Josué Tille 2018-04-30 21:41:07 +02:00
parent 2c7b930637
commit dd2a128e76
6 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,6 @@
#/bin/bash
if [[ $(systemctl status monitorix.service | grep "Active" | cut -d'(' -f2 | cut -d ')' -f1) = 'running' ]]
then
systemctl restart monitorix.service
fi

View file

@ -52,7 +52,6 @@ config_monitorix() {
ynh_replace_string __MYSQL_USER__ $dbuser $monitorix_conf
ynh_replace_string MYSQL_PASSWORD $dbpass $monitorix_conf
cp $monitorix_conf /etc/monitorix/monitorix.conf
}
set_permission() {

View file

@ -26,6 +26,9 @@ domain=$(ynh_app_setting_get "$app" domain)
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
ynh_backup "/etc/nginx/conf.d/monitorix_status.conf" "monitorix_status.conf"
# Copy hook
ynh_backup "/usr/share/yunohost/hooks/post_iptable_rules/50-$app"
# Copy Monitorix configuration
ynh_backup "/etc/monitorix" "config"

View file

@ -51,6 +51,14 @@ config_nginx
# Update monitorix configuration
config_monitorix
# Add hook
mkdir -p /usr/share/yunohost/hooks/post_iptable_rules
cp ../conf/post_iptable_rules_hook /usr/share/yunohost/hooks/post_iptable_rules/50-$app
#=================================================
# GENERIC FINALIZATION
#=================================================
# Set access
set_permission

View file

@ -33,6 +33,7 @@ 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

View file

@ -48,6 +48,10 @@ config_nginx
# Update monitorix configuration
config_monitorix
# Add hook
mkdir -p /usr/share/yunohost/hooks/post_iptable_rules
cp ../conf/post_iptable_rules_hook /usr/share/yunohost/hooks/post_iptable_rules/50-$app
#=================================================
# GENERIC FINALIZATION
#=================================================