From 525949e027d89a5c8ef0d1b7012446bb652be659 Mon Sep 17 00:00:00 2001 From: Remi Bergsma Date: Wed, 16 Dec 2015 11:27:26 +0100 Subject: [PATCH] CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh --- .../patches/debian/config/opt/cloud/bin/checkrouter.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh index 0ba0ee5013b..f867a4846c7 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh @@ -19,19 +19,19 @@ STATUS=UNKNOWN INTERFACE=eth1 ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g') -if [ $ROUTER_TYPE = "router" ] +if [ "$ROUTER_TYPE" = "router" ] then ROUTER_STATE=$(ip addr | grep eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo "MASTER"; else echo "BACKUP"; fi') STATUS=$ROUTER_STATE else ROUTER_STATE=$(ip addr | grep $INTERFACE | grep state | awk '{print $9;}') - if [ $ROUTER_STATE = "UP" ] + if [ "$ROUTER_STATE" = "UP" ] then STATUS=MASTER - elif [ $ROUTER_STATE = "DOWN" ] + elif [ "$ROUTER_STATE" = "DOWN" ] then STATUS=BACKUP fi fi -echo "Status: ${STATUS}" \ No newline at end of file +echo "Status: ${STATUS}"