Skip to content

Commit b7988a3

Browse files
ustcweizhouyadvr
authored andcommitted
vr: Fix vpc router in UNKNOWN state (#3465)
If there are more than 10 vpc tiers or public ip subnets in a VPC, eth1X will be added in vpc router. The redundant state is UNKNOWN in this case.
1 parent b509e08 commit b7988a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

systemvm/debian/opt/cloud/bin/checkrouter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ fi
2727
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
2828
if [ "$ROUTER_TYPE" = "router" ]
2929
then
30-
ROUTER_STATE=$(ip addr | grep eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo "MASTER"; else echo "BACKUP"; fi')
30+
ROUTER_STATE=$(ip addr show dev eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo "MASTER"; else echo "BACKUP"; fi')
3131
STATUS=$ROUTER_STATE
3232
else
33-
ROUTER_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
33+
ROUTER_STATE=$(ip addr show dev eth1 | grep state | awk '{print $9;}')
3434
if [ "$ROUTER_STATE" = "UP" ]
3535
then
3636
STATUS=MASTER

0 commit comments

Comments
 (0)