Displaying 1 result from an estimated 1 matches for "cassnadra".
Did you mean:
cassandra
2015 Apr 19
4
bash script fails conditional test
...creen
-e s3fs|awk '{print $2}')
if [[ -e $pid ]]
then
echo "Cassandra is running with pid: $pid"
else
echo "Cassandra is DOWN!!!"
fi
But for some reason the script doesn't realize that the pid variable has
been set, and fails the condition. It then reports that Cassnadra is
DOWN!!!".
[root at web1:~] #sh -x ./bin/check-cass.sh
++ ps -ef
++ grep -v grep
++ grep -i -v -e grep -e screen -e s3fs
++ awk '{print $2}'
++ grep cassandra
+ pid=26979
+ [[ -e 26979 ]]
+ echo 'Cassandra is DOWN!!!'
Cassandra is DOWN!!!
Can anybody tell me where I'm g...