annotate host/check_app.sh @ 1631:35c626c06dd5

add startup scripts for mac os
author fffilimonov
date Mon, 13 Dec 2021 09:14:52 +0000
parents 520707a70379
children 665049cffc02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1628
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 PIDS="";
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 function getPids() {
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 PIDS=$(ps ax | awk '{if($0~"[r]un.luan"){print $1}}');
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 }
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 function checkStopped() {
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 getPids;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 if [ "$PIDS" != "" ]; then
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 echo "App already running";
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 exit 0;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 fi;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 }
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 function checkRunning() {
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 getPids;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 if [ "$PIDS" != "" ]; then
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 echo "App running";
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 else
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 echo "App not running";
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 exit 0;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 fi;
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 }