#!/bin/bash #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression "Updating NGINX web server configuration..." ynh_config_change_url_nginx #================================================= # SET NEW URL #================================================= ynh_script_progression "Setting the new URL..." if [ "$change_domain" -eq 1 ]; then ynh_replace --file="$install_dir/LocalSettings.php" \ --match="\$wgServer = \"https://$old_domain\";" \ --replace="\$wgServer = \"https://$new_domain\";" fi if [ $change_path -eq 1 ]; then if [ "$old_path" = "/" ]; then old_scriptpath="" else old_scriptpath=$old_path fi if [ "$new_path" = "/" ]; then new_scriptpath="" else new_scriptpath=$new_path fi ynh_replace --file="$install_dir/LocalSettings.php" \ --match="\$wgScriptPath = \"$old_scriptpath\";" \ --replace="\$wgScriptPath = \"$new_scriptpath\";" fi #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Change of URL completed for $app"