cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [2/4] git commit: updated refs/heads/master to 738b788
Date Tue, 08 Dec 2015 19:12:33 GMT
CLOUDSTACK-9118 - Improves the existing checkrouter.sh script


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f81a2935
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f81a2935
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f81a2935

Branch: refs/heads/master
Commit: f81a29351d2c20714db1220c32fee4cdff61ed3b
Parents: 6d3fffa
Author: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Authored: Mon Dec 7 19:18:20 2015 +0100
Committer: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Committed: Tue Dec 8 11:06:35 2015 +0100

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/checkrouter.sh  | 20 +++++++++++---------
 .../opt/cloud/templates/checkrouter.sh.templ    | 20 +++++++++++---------
 2 files changed, 22 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f81a2935/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
index f05b440..0ba0ee5 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
@@ -21,15 +21,17 @@ INTERFACE=eth1
 ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
 if [ $ROUTER_TYPE = "router" ]
 then
-    INTERFACE=eth2
+	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" ]
+	then
+	    STATUS=MASTER
+	elif [ $ROUTER_STATE = "DOWN" ]
+	then
+	    STATUS=BACKUP
+	fi
 fi
 
-ETH1_STATE=$(ip addr | grep $INTERFACE | grep state | awk '{print $9;}')
-if [ $ETH1_STATE = "UP" ]
-then
-    STATUS=MASTER
-elif [ $ETH1_STATE = "DOWN" ]
-then
-    STATUS=BACKUP
-fi
 echo "Status: ${STATUS}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f81a2935/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
index f05b440..0ba0ee5 100755
--- a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
+++ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
@@ -21,15 +21,17 @@ INTERFACE=eth1
 ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
 if [ $ROUTER_TYPE = "router" ]
 then
-    INTERFACE=eth2
+	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" ]
+	then
+	    STATUS=MASTER
+	elif [ $ROUTER_STATE = "DOWN" ]
+	then
+	    STATUS=BACKUP
+	fi
 fi
 
-ETH1_STATE=$(ip addr | grep $INTERFACE | grep state | awk '{print $9;}')
-if [ $ETH1_STATE = "UP" ]
-then
-    STATUS=MASTER
-elif [ $ETH1_STATE = "DOWN" ]
-then
-    STATUS=BACKUP
-fi
 echo "Status: ${STATUS}"
\ No newline at end of file


Mime
View raw message