You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
337 B
Bash

#!/bin/bash
pidAna=`ps -ef |grep mqtt-1.0.0 | grep -v 'grep'| awk '{print $2}'`
err=0
if [ ! $pidAna ]; then
echo "mqtt-1.0.0 is down"
err=1
else
echo "mqtt-1.0.0 is running"
fi
if [ $err == 0 ]; then
touch BASE_DIR/RUNNING.lock
else
if [ -e "BASE_DIR/RUNNING.lock" ]; then
BASE_DIR/startMqtt.sh
fi
fi