I have the following simple bash script. for some reason it always returns true.
#!/bin/bash
service=hhvm
status=($(ps -ef | grep -v grep | grep $service | wc -l))
if [[ $status -eq 0 ]]; then
echo "starting $service"
service hhvm start
else
echo "$service running"
fi