Chore: Add gerrit maven verify GHA workflow
[sdnc/oam.git] / installation / sdnc / src / main / scripts / monitorCertsInstall.sh
1 #!/bin/sh
2
3 OKFILE=${ODL_HOME}/data/log/INSTALLCERTSPASS
4 NOTOKFILE=${ODL_HOME}/data/log/INSTALLCERTSFAIL
5 INSTALLCOMPLETE=false
6 elapsedTime=0
7
8 printInstallCertsLog() {
9   printf "################ Contents of ${ODL_HOME}/data/log/installCerts.log ################ \n"
10   cat ${ODL_HOME}/data/log/installCerts.log
11 }
12
13 while [[ $INSTALLCOMPLETE != true ]]; do
14   printf "Certificate installation in progress. Elapsed time - $elapsedTime secs. Waiting for 10 secs before checking the status.. \n"
15   sleep 10
16   elapsedTime=$((elapsedTime + 10))
17   pid=$(pgrep -f installCerts.py)
18   if [[ $? != 0 ]]; then
19      INSTALLCOMPLETE=true
20   fi
21 done
22
23 printf "Certificate installation script completed execution \n"
24 if [ -f $OKFILE ]; then
25   #do nothing
26   printf "Everything OK in Certificate Installation \n"
27 elif [ -f $NOTOKFILE ]; then
28   # Terminate SDNR container
29   printf "Problems encountered in Certificate Installation \n"
30   printInstallCertsLog
31   printf "Stoppping SDNR container due to failure in installing Certificates \n"
32   pid=`pgrep java`
33   kill -SIGKILL $pid
34 fi
35