From 3d8fc19c54c022aae8229961dd5408dd4a2f01ee Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 15 May 2017 22:31:42 +0200 Subject: [PATCH] [fix]set port on upgrade --- scripts/upgrade | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index e59be3f..d2ade72 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,13 @@ source /usr/share/yunohost/helpers domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) is_public=$(ynh_app_setting_get "$app" is_public) +port=$(ynh_app_setting_get "$app" port) + +# test port settings +if [[ "$port" = "" ]]; then + port=3000 + ynh_app_setting_set $app port $port +fi # Fix path if needed path=$(fix_path $path) @@ -33,6 +40,7 @@ else fi sed -i "s@YNH_WWW_PATH@${path}@g" $nginx_conf +sed -i "s@YNH_WWW_PORT@$port@g" $nginx_conf sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf # If app is public, add url to SSOWat conf as skipped_uris @@ -42,4 +50,4 @@ if [[ $is_public -eq 1 ]]; then fi # Reload nginx service -sudo systemctl reload nginx \ No newline at end of file +sudo systemctl reload nginx