From 5d75aa4a75749558bc16045dd79925d8c0dc172a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 3 Mar 2018 18:53:33 +0100 Subject: [PATCH] peer_port also on UDP --- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 3cfff11..ca6a5ec 100644 --- a/scripts/install +++ b/scripts/install @@ -59,7 +59,7 @@ ynh_app_setting_set $app port $port # Find a free port peer_port=$(ynh_find_port 51413) # Open this port -yunohost firewall allow TCP $peer_port >/dev/null 2>&1 +yunohost firewall allow Both $peer_port >/dev/null 2>&1 ynh_app_setting_set $app peer_port $peer_port #================================================= diff --git a/scripts/remove b/scripts/remove index f89c7f8..ccac21f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -51,7 +51,7 @@ fi if yunohost firewall list | grep -q "\- $peer_port$" then echo "Close port $peer_port" - yunohost firewall disallow TCP $peer_port 2>&1 + yunohost firewall disallow Both $peer_port 2>&1 fi #================================================= diff --git a/scripts/restore b/scripts/restore index bb6e1ce..b9ccb69 100644 --- a/scripts/restore +++ b/scripts/restore @@ -52,7 +52,7 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= yunohost firewall allow --no-upnp TCP $port >/dev/null 2>&1 -yunohost firewall allow TCP $peer_port >/dev/null 2>&1 +yunohost firewall allow Both $peer_port >/dev/null 2>&1 #================================================= # SPECIFIC RESTORE diff --git a/scripts/upgrade b/scripts/upgrade index 45f99fa..7ebcab0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,6 +33,9 @@ if [ -z $peer_port ]; then ynh_app_setting_set $app peer_port $peer_port fi +# Add peer_port also on UDP. +yunohost firewall allow UDP $peer_port >/dev/null 2>&1 + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================