From 799dcd4050c3599525435e18b22107c98594ff41 Mon Sep 17 00:00:00 2001 From: jzonthemtn Date: Wed, 15 Dec 2021 09:56:51 -0500 Subject: [PATCH] Parameterizing the hostname for indexing and defaulting to localhost. --- index.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.sh b/index.sh index 54ae880..4e0c427 100755 --- a/index.sh +++ b/index.sh @@ -1,11 +1,14 @@ #!/bin/bash + +HOSTNAME=${1:-localhost} + if [ ! -f ./tmdb_solr.json ]; then unzip tmdb_solr.json.zip fi # delete (or wipe) the tmdb index and reindex -curl http://localhost:8983/solr/tmdb/update --data '*:*' -H 'Content-type:text/xml; charset=utf-8' +curl "http://$HOSTNAME:8983/solr/tmdb/update" --data '*:*' -H 'Content-type:text/xml; charset=utf-8' -curl http://localhost:8983/solr/tmdb/update --data '' -H 'Content-type:text/xml; charset=utf-8' +curl "http://$HOSTNAME:8983/solr/tmdb/update" --data '' -H 'Content-type:text/xml; charset=utf-8' -curl 'http://localhost:8983/solr/tmdb/update?commit=true' --data-binary @tmdb_solr.json -H 'Content-type:application/json' +curl "http://$HOSTNAME:8983/solr/tmdb/update?commit=true" --data-binary @tmdb_solr.json -H 'Content-type:application/json'