1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ampache_ynh.git synced 2024-09-03 18:15:55 +02:00
ampache_ynh/scripts/change_url
Éric Gaspar 4cec581f48 v2
2023-06-11 21:57:46 +02:00

37 lines
1.3 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# CHANGE AMPACHE CONFIGURATION
#=================================================
ynh_script_progression --message="Updating Ampache configuration..."
conf_file="$install_dir/config/ampache.cfg.php"
ynh_replace_string --match_string="\(web_path.*=.*\)\"$old_path\"" --replace_string="\1\"$new_path\"" --target_file="$conf_file"
ynh_replace_string --match_string="\(http_host.*=.*\)\"$old_domain\"" --replace_string="\1\"$new_domain\"" --target_file="$conf_file"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last