view host/check_app.sh @ 1720:2f4c99c02436

add GoodUtils.split
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 25 Jul 2022 17:31:50 -0600 (2022-07-25)
parents 665049cffc02
children
line wrap: on
line source
PIDS="";

export PATH="$PATH:/usr/local/bin";

function getPids() {
  PIDS=$(ps ax | awk '{if($0~"[r]un.luan"){print $1}}');
}

function checkStopped() {
  getPids;
  if [ "$PIDS" != "" ]; then
    echo "App already running";
    exit 0;
  fi;
}

function checkRunning() {
  getPids;
  if [ "$PIDS" != "" ]; then
    echo "App running";
  else
    echo "App not running";
    exit 0;
  fi;
}