Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Solr scripts that post commands to solr don't check the return code.
The scripts (like optimize) currently follow this pattern:
rs=`curl http://localhost:5051/update -s -d "<optimize/>"`
if [[ $? != 0 ]]
then
[...]
fi
- check status of optimize request
rc=`echo $rs|cut -f2 -d'"'`
if [[ $? != 0 ]]
then
[...]
$rc is never checked. In addition, the line that grabs rc appears pretty
fragile by depending on an exact field column. Unless we have a simple command
line XML parser, how about checking for the return code this way:
echo $rs | grep '<response.*status="0"' > /dev/null 2>&1
if [[ $? != 0 ]]
then
[...]