1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mediawiki_ynh.git synced 2024-09-03 19:46:05 +02:00
mediawiki_ynh/scripts/change_url

51 lines
1.5 KiB
Text
Raw Permalink Normal View History

2019-02-27 23:52:47 +01:00
#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2019-02-27 23:52:47 +01:00
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
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
2019-02-27 23:52:47 +01:00
#=================================================
# SET NEW URL
2019-02-27 23:52:47 +01:00
#=================================================
ynh_script_progression --message="Setting the new URL..." --weight=1
2024-04-12 10:35:52 +02:00
if [ "$change_domain" -eq 1 ]; then
ynh_replace_string --target_file="$install_dir/LocalSettings.php" \
--match_string="\$wgServer = \"https://$old_domain\";" \
--replace_string="\$wgServer = \"https://$new_domain\";"
fi
2024-04-12 10:35:52 +02:00
if [ $change_path -eq 1 ]; then
2023-09-04 13:19:22 +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
2024-04-12 10:35:52 +02:00
ynh_replace_string --target_file="$install_dir/LocalSettings.php" \
--match_string="\$wgScriptPath = \"$old_scriptpath\";" \
--replace_string="\$wgScriptPath = \"$new_scriptpath\";"
fi
2019-02-27 23:52:47 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last