From 1875a6386b49412a00ce2f79a121062f19e55071 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 23 May 2021 14:46:30 +0200 Subject: [PATCH] Fix discovery arg tests --- scripts/install | 4 ++-- scripts/remove | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 6c7ac51..991a865 100644 --- a/scripts/install +++ b/scripts/install @@ -76,7 +76,7 @@ if [ $discovery -eq 1 ]; then ynh_script_progression --message="Configuring firewall..." --time --weight=1 # Open port 1900 for service auto-discovery - if [ ynh_port_available --port=1900 ]; then + if [[ $(ynh_port_available --port=1900) -eq 1 ]]; then ynh_exec_warn_less yunohost firewall allow UDP 1900 ynh_app_setting_set --app=$app --key=discovery_service --value=1 else @@ -85,7 +85,7 @@ if [ $discovery -eq 1 ]; then fi # Open port 7359 for client auto-discovery - if [ ynh_port_available --port=7359 ]; then + if [[ $(ynh_port_available --port=7359) -eq 1 ]]; then ynh_exec_warn_less yunohost firewall allow UDP 7359 ynh_app_setting_set --app=$app --key=discovery_client --value=1 else diff --git a/scripts/remove b/scripts/remove index 0f35084..83a3d43 100644 --- a/scripts/remove +++ b/scripts/remove @@ -74,13 +74,13 @@ ynh_remove_logrotate # CLOSE A PORT #================================================= -if [ $discovery_server -eq 1 ] && [ yunohost firewall list | grep -q "\- 1900$" ] +if [[ $discovery_server -eq 1 ]] && yunohost firewall list | grep -q "\- 1900$" then ynh_script_progression --message="Closing port 1900..." --time --weight=1 ynh_exec_warn_less yunohost firewall disallow UDP 1900 fi -if [ $discovery_client -eq 1 ] && [ yunohost firewall list | grep -q "\- 7359$" ] +if [[ $discovery_client -eq 1 ]] && yunohost firewall list | grep -q "\- 7359$" then ynh_script_progression --message="Closing port 7359..." --time --weight=1 ynh_exec_warn_less yunohost firewall disallow UDP 7359