diff --git a/scripts/change_url b/scripts/change_url index 75baa0b..100c413 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -96,9 +96,28 @@ fi #================================================= # ======= modif perso ======= -ynh_replace_string "\$wgServer = \"https://$old_domain\";" - "\$wgServer = \"https://$new_domain\";" "$final_path/LocalSettings.php" -ynh_replace_string "\$wgScriptPath = \"$old_path\";" "\$wgScriptPath = \"$new_path\";" "$final_path/LocalSettings.php" +# change domain +if [ $change_domain -eq 1 ] +then + ynh_replace_string "\$wgServer = \"https://$old_domain\";" "\$wgServer = \"https://$new_domain\";" "$final_path/LocalSettings.php" +fi +# change path +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_string "\$wgScriptPath = \"$old_scriptpath\";" "\$wgScriptPath = \"$new_scriptpath\";" "$final_path/LocalSettings.php" +fi # ======= modif perso ======= #================================================= diff --git a/scripts/install b/scripts/install index 3256362..7387a59 100755 --- a/scripts/install +++ b/scripts/install @@ -250,9 +250,15 @@ fi #php $final_path/maintenance/update.php +if [ "$path_url" = "/" ]; then + scriptpath="" +else + scriptpath=$path_url +fi + php $final_path/maintenance/install.php --conf $final_path \ --server "https://$domain" \ - --scriptpath $path_url \ + --scriptpath "$scriptpath" \ --dbuser $db_name \ --dbpass $db_pwd \ --dbname $db_name \