I found that the forms server is started by java with Dweblogic.Name=WLS_FORMS as a parameter.
Since ps aux | grep WLS_FORMS
can detect the info, so I changed the script as below, it works fine now
#!/bin/bash
if [ $( ps aux | grep WLS_FORMS |wc -l) -eq 1 ]
then
echo "Process is not running."
service oracleforms start
else
echo "Process is running."
fi