diff --git a/scripts/install b/scripts/install index 78b0e68..6ce91d7 100755 --- a/scripts/install +++ b/scripts/install @@ -180,9 +180,15 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= + +# Build the ports list +needed_ports=() +needed_ports+=( "$port" ) +needed_ports+=( "$secure_port" ) + ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port" +yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 593a8f5..62f664f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -34,6 +34,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path_www=$(ynh_app_setting_get --app=$app --key=final_path_www) +port=$(ynh_app_setting_get --app=$app --key=port) +secure_port=$(ynh_app_setting_get --app=$app --key=secure_port) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -108,7 +110,12 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port" +# Build the ports list +needed_ports=() +needed_ports+=( "$port" ) +needed_ports+=( "$secure_port" ) + +yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 313dab9..097c441 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,7 +113,12 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port" +# Build the ports list +needed_ports=() +needed_ports+=( "$port" ) +needed_ports+=( "$secure_port" ) + +yunohost service add $app --description="A modern IRC server" --log="/var/log/$app/$app.log" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # START SYSTEMD SERVICE