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

write change_url script

This commit is contained in:
mh4ckt3mh4ckt1c4s 2023-03-01 20:34:38 +01:00
parent 5e7de6edcb
commit 73c3ca950d

View file

@ -74,7 +74,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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 # MODIFY URL IN NGINX CONF
@ -91,8 +91,9 @@ then
# Set global variables for NGINX helper # Set global variables for NGINX helper
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
path_no_root=${path_url%/}
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config "path_no_root"
fi fi
# Change the domain for NGINX # Change the domain for NGINX
@ -108,8 +109,11 @@ fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # 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 # GENERIC FINALISATION
@ -118,7 +122,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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 # RELOAD NGINX