I have a shell script like this.
#!/bin/sh
s=$1
pro=`ps -ef | grep $s | grep -v grep | grep -v test3.sh | wc -l`
if [ $pro -eq 0 ]
then
echo "Service $s is DOWN..."
echo "Service $s is DOWN..." >> processlogs.txt
echo "Starting Service $s..."
echo "Starting Service $s..." >> processlogs.txt
java -jar clientApplication.jar $s &
else
echo "Service $s is Running..."
echo "Service $s is Running..." >> processlogs.txt
fi
When I execute the shell script, and the operation enters in the if condition it never come back. It continuously executes the command "java -jar clientApplication.jar $s". But there is no problem in else condition. Is my syntax wrong or any logical error.
Thanks ...