test.sh
-------------------------------------------------------------------------------------------------------------
#!/bin/sh
while :
do
run1=$(ps -ef |grep 'sxnx-sms-8081' |grep -v "grep")
if [ "$run1" ] ; then
echo "The sxnx-sms-8081 service is alive!"
else
echo "The sxnx-sms service was shutdown!"
echo "Starting service sxnx-sms-8081..."
nohup java -jar $PWD/sxnx-sms-8081.jar&
echo "The service sxnx-sms-8081 was started!"
fi
sleep 10
done