You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/20 08:01:17 UTC
[12/13] git commit: updated refs/heads/master to 6fe5ae0
CLOUDSTACK-8952 - Make the checkrouter.sh compatible with RVR as well
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fb33cb28
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fb33cb28
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fb33cb28
Branch: refs/heads/master
Commit: fb33cb28aba7bfc829651e8881a9a6afa6a70a76
Parents: 38d0357
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Sat Oct 17 14:48:08 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Sat Oct 17 15:52:28 2015 +0200
----------------------------------------------------------------------
.../debian/config/opt/cloud/bin/checkrouter.sh | 14 ++++++++++++--
.../config/opt/cloud/templates/checkrouter.sh.templ | 14 ++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fb33cb28/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 9579b11..f05b440 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
@@ -16,10 +16,20 @@
# specific language governing permissions and limitations
# under the License.
-STATUS=BACKUP
-ETH1_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
+STATUS=UNKNOWN
+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
+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/fb33cb28/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 9579b11..f05b440 100755
--- a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
+++ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
@@ -16,10 +16,20 @@
# specific language governing permissions and limitations
# under the License.
-STATUS=BACKUP
-ETH1_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
+STATUS=UNKNOWN
+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
+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