diff --git a/conf/post_iptable_rules b/conf/post_iptable_rules new file mode 100644 index 0000000..b0a3f04 --- /dev/null +++ b/conf/post_iptable_rules @@ -0,0 +1,5 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers + +iptables -t filter -A INPUT -i lxdbr0 -p udp -d 255.255.255.255 --dport 67 -j ACCEPT diff --git a/scripts/install b/scripts/install index 5445d22..94dd986 100644 --- a/scripts/install +++ b/scripts/install @@ -188,6 +188,15 @@ ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# ADD FIREWALL RULES +#================================================= +ynh_script_progression --message="Adding firewall rules..." + +mkdir -p "/etc/yunohost/hooks.d/post_iptable_rules" +ynh_add_config --template="post_iptable_rules" --destination="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}" +yunohost firewall reload + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 524c878..142ee5f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -85,6 +85,13 @@ ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app +#================================================= +# REMOVE FIREWALL RULES +#================================================= +ynh_script_progression --message="Removing firewall rules..." + +yunohost firewall reload + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index a51a6ae..1fa8640 100644 --- a/scripts/restore +++ b/scripts/restore @@ -130,6 +130,15 @@ ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# ADD FIREWALL RULES +#================================================= +ynh_script_progression --message="Adding firewall rules..." + +mkdir -p "/etc/yunohost/hooks.d/post_iptable_rules" +ynh_add_config --template="post_iptable_rules" --destination="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}" +yunohost firewall reload + #================================================= # END OF SCRIPT #=================================================