2022-11-23 10:08:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_systemctl --service="uwsgi-app@$app.service" --action="stop" --log_path="/var/log/uwsgi/$app/$app.log"
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_config_change_url_nginx
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2023-03-01 20:34:38 +01:00
|
|
|
# RECONFIGURING SEARXNG
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Reconfiguring SearXNG..."
|
2023-03-01 20:34:38 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_replace --match="base_url: https://$old_domain$old_path" --replace="base_url: https://$new_domain$new_path" --file="$install_dir/settings.yml"
|
|
|
|
ynh_replace --match="instance_name: SearXNG - $old_domain" --replace="instance_name: SearXNG - $new_domain" --file="$install_dir/settings.yml"
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_systemctl --service="uwsgi-app@$app.service" --action="start" --log_path="/var/log/uwsgi/$app/$app.log"
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Change of URL completed for $app"
|