Skip to content

Commit

Permalink
Add missing imports and remove unused parameter (#434)
Browse files Browse the repository at this point in the history
* Add missing imports

* Remove unused variableArrayIndex parameter
  • Loading branch information
naresh-kumar-babu authored Sep 2, 2024
1 parent ea2ce42 commit d40ef79
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _sources/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ get_mediawiki_db_var() {
echo "Unexpected variable name passed to the get_mediawiki_db_var() function: $1"
return
esac
VALUE=$(php /getMediawikiSettings.php --variable=wgDBservers --variableArrayIndex="[0,\"$I\"]" --format=string)
VALUE=$(php /getMediawikiSettings.php --variable=wgDBservers --format=string)
if [ -z "$VALUE" ]; then
VALUE=$(get_mediawiki_variable "$1")
fi
Expand All @@ -50,7 +50,7 @@ get_hostname_with_port() {
get_mediawiki_cirrus_search_server() {
server=$(get_mediawiki_variable wgCirrusSearchServers first)
if [ -z "$server" ]; then
server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --variableArrayIndex="[\"default\",0]" --format=string)
server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --format=string)
fi
get_hostname_with_port "$server" 9200
}
Expand Down
1 change: 1 addition & 0 deletions _sources/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ cd "$MW_HOME" || exit
echo "Checking for LocalSettings..."
if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then
# Run auto-update
. /run-maintenance-scripts.sh
run_autoupdate
if [ -e "$MW_VOLUME/config/wikis.yaml" ]; then
config_subdir_wikis
Expand Down
4 changes: 4 additions & 0 deletions _sources/scripts/update-docker-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -x

. /functions.sh

get_docker_gateway () {
getent hosts "gateway.docker.internal" | awk '{ print $1 }'
}

# Try to fetch gateway IP from extra host
DOCKER_GATEWAY=$(get_docker_gateway)

Expand Down

0 comments on commit d40ef79

Please sign in to comment.