From 38f036207b1ba4c7fa92ddc94c7d60ee82a507b6 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Mon, 19 Aug 2013 12:38:30 +0200 Subject: [PATCH] Add help. Add path option --- scripts/commit_solr.sh | 19 ++++++++++++++++--- scripts/delete_solr.sh | 22 ++++++++++++++-------- scripts/optimize_solr.sh | 18 ++++++++++++------ 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/scripts/commit_solr.sh b/scripts/commit_solr.sh index 2b3f6c3..6e3dff2 100644 --- a/scripts/commit_solr.sh +++ b/scripts/commit_solr.sh @@ -1,4 +1,17 @@ #!/bin/bash -HOST=localhost -PORT=8080 -curl http://$HOST:$PORT/solr/update -H "Content-Type: text/xml" --data-binary '' \ No newline at end of file +HOST_PORT=localhost:8080 + +if [ "$2" != "" ] ; then + HOST_PORT="$2" +fi + +PATH=solr4 +if [ "$2" != "" ] ; then + PATH="$2" +fi + +if [ "$1" == "-h" ] ; then + echo "$0 [[HOST:PORT] PATH] (default $HOST_PORT/$PATH)" +fi + +curl http://$HOST:$PORT/$PATH/update -H "Content-Type: text/xml" --data-binary '' \ No newline at end of file diff --git a/scripts/delete_solr.sh b/scripts/delete_solr.sh index 2b91d65..c5f9f85 100755 --- a/scripts/delete_solr.sh +++ b/scripts/delete_solr.sh @@ -1,14 +1,20 @@ #!/bin/bash -if [ "$1" == "" ] ; then - echo "$0 databaseid [HOST:PORT] " - exit 1 ; -fi -HOSTPORT="localhost:8080" +HOST_PORT="localhost:8080" if [ "$2" != "" ] ; then - HOSTPORT="$2" + HOST_PORT="$2" fi -curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary "database:$1" -curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary '' +PATH=solr4 +if [ "$3" != "" ] ; then + PATH="$3" +fi + +if [ "$1" == "" ] ; then + echo "$0 databaseid [[HOST:PORT] PATH] (default $HOST_PORT/$PATH)" + exit 1 ; +fi + +curl http://${HOST_PORT}/$PATH/update -H "Content-Type: text/xml" --data-binary "database:$1" +curl http://${HOST_PORT}/$PATH/update -H "Content-Type: text/xml" --data-binary '' diff --git a/scripts/optimize_solr.sh b/scripts/optimize_solr.sh index bb4127d..d608b4a 100755 --- a/scripts/optimize_solr.sh +++ b/scripts/optimize_solr.sh @@ -1,14 +1,20 @@ #!/bin/bash -if [ "$1" != "YES" ] ; then - echo "No confirmation given" - exit 1 ; -fi - HOST_PORT=localhost:8080 if [ "$2" != "" ] ; then HOST_PORT="$2" fi -curl http://${HOST_PORT}/solr/update -H "Content-Type: text/xml" --data-binary '' +PATH=solr4 +if [ "$3" != "" ] ; then + PATH="$3" +fi + +if [ "$1" != "YES" ] ; then + echo "$0 YES [[HOST:PORT] PATH] (default $HOST_PORT/$PATH)" + exit 1 ; +fi + + +curl http://${HOST_PORT}/$PATH/update -H "Content-Type: text/xml" --data-binary '' -- 1.7.10.4