From 629fbd55c55f89cbf08f6dbce337b5a0e8195f34 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:51:27 +0200 Subject: [PATCH] Fix needs_exposed_ports --- scripts/install | 4 +++- scripts/restore | 4 +++- scripts/upgrade | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index c18429e..740294c 100755 --- a/scripts/install +++ b/scripts/install @@ -80,9 +80,11 @@ ynh_app_setting_set --app=$app --key=serf_port --value=$serf_port # Open the port ynh_script_progression --message="Configuring firewall..." ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +needs_exposed_ports="$rpc_port" if [ "$node_type" == "server" ] then ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port + needs_exposed_ports="$serf_port $needs_exposed_ports" fi #================================================= @@ -220,7 +222,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index f271791..7f460de 100755 --- a/scripts/restore +++ b/scripts/restore @@ -98,9 +98,11 @@ chown -R $app:$app "$config_path" # Open the port ynh_script_progression --message="Configuring firewall..." ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +needs_exposed_ports="$rpc_port" if [ "$node_type" == "server" ] then ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port + needs_exposed_ports="$serf_port $needs_exposed_ports" fi if [ "$node_type" == "client" ] @@ -137,7 +139,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index b30f818..b8d7869 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -179,7 +179,12 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +needs_exposed_ports="$rpc_port" +if [ "$node_type" == "server" ] +then + needs_exposed_ports="$serf_port $needs_exposed_ports" +fi +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE