1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yacy_ynh.git synced 2024-09-03 18:05:59 +02:00
yacy_ynh/scripts/change_url
2024-01-14 21:46:44 +01:00

53 lines
2 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..."
ynh_systemd_action --service_name="$app" --action="stop" --log_path="$data_dir/DATA/LOG/yacy00.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
ynh_replace_string --target_file="$data_dir/DATA/SETTINGS/yacy.conf" \
--match_string="promoteSearchPageGreeting.homepage=https://$old_domain$old_path" \
--replace_string="promoteSearchPageGreeting.homepage=https://$new_domain$new_path"
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path="$data_dir/DATA/LOG/yacy00.log" --line_match="Started httpd:"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app"