zhangqian
2023-12-08 fcde53508c9da3a22337298b9daf4df603180531
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
 
ID=$1
 
if [ -z $ID ]; then
    echo "containerid must't be empty,invalid start arg!!!"
    exit -1
fi
 
echo -n $ID>/aps/container.txt
 
startFunc() {
  PROC=`ps aux | grep "$1" | grep -v grep | grep -v tail`
  if [ -z "${PROC}" ]; then
         date +%D-%T" $1 start"
         nohup ./$1 > /dev/null 2>&1  &
   else
         echo "$1 is exists"
   fi
}
 
 
#cd /aps
 
#if etcd process not exist, saas-user-service will stop
#nohup ./saas-user-service >/dev/null 2>&1 &
#./saas-api-saas
 
while true
do
  startFunc apsClient
 
  sleep 2
done