1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/searxng_ynh.git synced 2024-09-03 20:26:00 +02:00
searxng_ynh/scripts/change_url

42 lines
1.6 KiB
Text
Raw Normal View History

2022-11-23 10:08:54 +01:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
2022-11-23 10:08:54 +01: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
#=================================================
ynh_script_progression "Updating NGINX web server configuration..."
2022-11-23 10:08:54 +01: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
#=================================================
ynh_script_progression "Reconfiguring SearXNG..."
2023-03-01 20:34:38 +01: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
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2022-11-23 10:08:54 +01: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
#=================================================
ynh_script_progression "Change of URL completed for $app"