comparison host/stop.sh @ 1628:520707a70379

add host
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 07 Dec 2021 23:29:58 -0700
parents
children b735ed134662
comparison
equal deleted inserted replaced
1627:07be5015159d 1628:520707a70379
1 #!/bin/bash
2
3 . check_app.sh;
4
5 #seconds to wait
6 toWait=30;
7 i=0;
8
9 getPids;
10
11 if [ "$PIDS" != "" ]; then
12 while [ $i -lt $toWait ]; do
13 kill -TERM $PIDS;
14 sleep 1;
15 getPids;
16 if [ "$PIDS" == "" ]; then
17 break
18 fi;
19 let i=$i+1;
20 done;
21
22 if [ "$PIDS" != "" ]; then
23 echo "Can't stop app in ${i} seconds";
24 exit 0;
25 else
26 rm started.lock;
27 echo "App stopped";
28 fi;
29 else
30 echo "no running app found";
31 fi;
32
33 #sudo /usr/local/bin/nginx -s stop;
34 exit 0;