2019-02-27 23:52:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-10 15:24:30 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
2019-02-27 23:52:47 +01:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2020-06-10 15:24:30 +02:00
|
|
|
|
2019-02-27 23:52:47 +01:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2020-06-10 15:24:30 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
2019-02-27 23:52:47 +01:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-12-17 20:16:02 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2019-02-27 23:52:47 +01:00
|
|
|
|
2023-04-10 16:26:24 +02:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2021-05-16 17:29:40 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
2019-02-27 23:52:47 +01:00
|
|
|
#=================================================
|
2019-07-27 22:09:37 +02:00
|
|
|
# SET NEW URL
|
2019-02-27 23:52:47 +01:00
|
|
|
#=================================================
|
2020-06-10 15:24:30 +02:00
|
|
|
ynh_script_progression --message="Setting the new URL..." --weight=1
|
|
|
|
|
2019-02-28 22:45:05 +01:00
|
|
|
if [ $change_domain -eq 1 ]
|
|
|
|
then
|
2023-04-10 16:26:24 +02:00
|
|
|
ynh_replace_string --match_string="\$wgServer = \"https://$old_domain\";" --replace_string="\$wgServer = \"https://$new_domain\";" --target_file="$install_dir/LocalSettings.php"
|
2019-02-28 22:45:05 +01:00
|
|
|
fi
|
2019-07-27 22:09:37 +02:00
|
|
|
|
2019-02-28 22:45:05 +01:00
|
|
|
if [ $change_path -eq 1 ]
|
|
|
|
then
|
2021-05-19 18:18:33 +02:00
|
|
|
if [ "$old_path" = "/" ]; then
|
|
|
|
old_scriptpath=""
|
|
|
|
else
|
|
|
|
old_scriptpath=$old_path
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$new_path" = "/" ]; then
|
|
|
|
new_scriptpath=""
|
|
|
|
else
|
|
|
|
new_scriptpath=$new_path
|
|
|
|
fi
|
|
|
|
|
2023-04-10 16:26:24 +02:00
|
|
|
ynh_replace_string --match_string="\$wgScriptPath = \"$old_scriptpath\";" --replace_string="\$wgScriptPath = \"$new_scriptpath\";" --target_file="$install_dir/LocalSettings.php"
|
2020-06-10 15:24:30 +02:00
|
|
|
fi
|
2019-02-27 23:52:47 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2020-06-10 15:24:30 +02:00
|
|
|
|
2019-07-27 22:09:37 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|