From 8656e21f00924c4358d0c205ba24ee25c282cae4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 13 Apr 2019 15:49:55 +0200 Subject: [PATCH] Swicth checkports --- scripts/install | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4886b35..b8f610d 100644 --- a/scripts/install +++ b/scripts/install @@ -59,20 +59,30 @@ ynh_app_setting_set $app path $path ynh_app_setting_set $app user $user ynh_app_setting_set $app channel $channel +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# FIND AND OPEN A PORT +#================================================= +ynh_print_info "Configuring firewall..." + # Check port availability sudo yunohost app checkport $GUIPORT if [[ ! $? -eq 0 ]]; then echo Port $GUIPORT for Syncthing UI is not available. exit 1 fi +ynh_app_setting_set $app guiport $GUIPORT + sudo yunohost app checkport $SYNCPORT if [[ ! $? -eq 0 ]]; then echo Port $SYNCPORT is for Syncthing protocol is not available. exit 1 fi -# Open port in firewall -sudo yunohost firewall allow TCP $SYNCPORT > /dev/null 2>&1 +# Open this port +ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $SYNCPORT +ynh_app_setting_set $app syncport $SYNCPORT # Create $SYNCUSER user to run syncthing service sudo useradd -m -d $SYNCHOME/ -s /bin/bash $SYNCUSER