view host/check_app.sh @ 2026:9c10e37c56f6

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 29 Oct 2025 21:38:14 -0600
parents 677795f0a4e7
children ee75b5c12272
line wrap: on
line source

PIDS="";

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

function getPids() {
  PIDS=$(ps ax | awk '{if($0~"[r]un(_host)?.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;
}