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
CodeShakingSheep f9c7dee1f8
Update change_url
Update instance_name in settings.yml
2024-04-14 11:02:30 -05:00

51 lines
2.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="stop" --log_path="/var/log/uwsgi/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
#=================================================
# 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="$install_dir/settings.yml"
ynh_replace_string --match_string="instance_name: SearXNG - $old_domain" --replace_string="instance_name: SearXNG - $new_domain" --target_file="$install_dir/settings.yml"
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="start" --log_path="/var/log/uwsgi/$app/$app.log"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last