Skip to content

Commit

Permalink
Add script to remove hakabana index
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi Talbi authored and Pierre-Sylvain Desse committed Sep 24, 2014
1 parent 68bf4d5 commit 5df77d9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hakabana-clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [[ -n "$1" ]]; then
res=$(curl -s -XDELETE $1/hakabana)
if [[ -z $res ]]; then
echo "check elasticsearch server address"
exit 0
fi
if [ "$res" == '{"acknowledged":true}' ]; then
echo "hakabana index removed successfully"
elif [[ "$res" == {\"error\":\"IndexMissingException* ]]; then
echo "'hakabana' missing index"
else
echo "failed to remove hakabana index"
fi
else
echo "usage: $0 <http://elasticsearch-server[:port]>"
fi

0 comments on commit 5df77d9

Please sign in to comment.