File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
systemvm/debian/opt/cloud/bin Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1818
1919STATUS=UNKNOWN
2020
21+ ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
22+ if [ " $ROUTER_TYPE " = " vpcrouter" ]; then
23+ GUEST_NICS=$( python3 -c "
24+ import json
25+ data = json.load(open('/etc/cloudstack/ips.json'))
26+ for nic, objs in data.items():
27+ if isinstance(objs, list):
28+ for obj in objs:
29+ if obj.get('nw_type') == 'guest' and obj.get('add'):
30+ print(nic)
31+ " )
32+ if [ " $GUEST_NICS " = " " ]; then
33+ echo " Status: ${STATUS} "
34+ exit
35+ fi
36+ fi
37+
2138if [ " $( systemctl is-active keepalived) " != " active" ]
2239then
2340 echo " Status: FAULT"
2441 exit
2542fi
2643
27- ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
2844if [ " $ROUTER_TYPE " = " router" ]
2945then
3046 ROUTER_STATE=$( ip -4 addr show dev eth0 | grep inet | wc -l | xargs bash -c ' if [ $0 == 2 ]; then echo "PRIMARY"; else echo "BACKUP"; fi' )
You can’t perform that action at this time.
0 commit comments