-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_status.sh
executable file
·31 lines (24 loc) · 1.12 KB
/
check_status.sh
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
#!/bin/bash
var1=$(docker exec -i nso1 bash -c 'NCS_IPC_PORT=4561 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data1=$(($var1))
var2=$(docker exec -i nso2 bash -c 'NCS_IPC_PORT=4562 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data2=$(($var2))
var3=$(docker exec -i nso3 bash -c 'NCS_IPC_PORT=4563 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data3=$(($var3))
Result=$(($Data1+$Data2+$Data3))
echo "NSO Status: "
echo -ne "NOT READY: NSO1 Status: $var1 / NSO2 Status: $var2 / NSO3 Status: $var3\033[0K\r"
while [ $Result -ne 0 ]
do
var1=$(docker exec -i nso1 bash -c 'NCS_IPC_PORT=4561 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data1=$(($var1))
var2=$(docker exec -i nso2 bash -c 'NCS_IPC_PORT=4562 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data2=$(($var2))
var3=$(docker exec -i nso3 bash -c 'NCS_IPC_PORT=4563 ncs_cli -C -u admin <<< "exit" &> /dev/null ; echo $?')
Data3=$(($var3))
Result=$(($Data1+$Data2+$Data3))
echo -ne "NOT READY: NSO1 Status: $var1 / NSO2 Status: $var2 / NSO3 Status: $var3\033[0K\r"
sleep 5
done
#sleep 2
echo -e "READY: NSO1, NSO2 and NSO3 Up\033[0K\r"