diff --git a/scripts/change_url b/scripts/change_url index 322641b..85a1a97 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -74,7 +74,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=uwsgi --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF @@ -91,8 +91,9 @@ then # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" + path_no_root=${path_url%/} # Create a dedicated NGINX config - ynh_add_nginx_config + ynh_add_nginx_config "path_no_root" fi # Change the domain for NGINX @@ -108,8 +109,11 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# RECONFIGURING SEARXNG #================================================= +ynh_script_progression --message="Reconfiguring SearXNG..." --weight=2 + +ynh_replace_string --match_string="base_url: \"https://$old_domain$old_path}\"" --replace_string="base_url: \"https://$new_domain$new_path\"" --target_file="$final_path/searxn/settings.yml" #================================================= # GENERIC FINALISATION @@ -118,7 +122,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=uwsgi-app@$app.service --action="start" --line_match="spawned uWSGI master process" --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX