From e6b3ee318c048ece6afde4c45c17b3652a59f3c0 Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Fri, 6 Feb 2015 13:21:09 +0100 Subject: [PATCH] Fix the checkrouter.sh script in order to report the routers state --- .../config/opt/cloud/templates/checkrouter.sh.templ | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 fbf4f0f54d0..35ba766886d 100755 --- a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ +++ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ @@ -44,10 +44,14 @@ then bumped="Bumped: YES" fi -stat=`tail -n 1 [RROUTER_LOG] | grep "Status"` +state="Status: BACKUP" +isMaster=`grep -Po '(?<="redundant_master": ")[^"]*' /etc/cloudstack/cmdline.json` if [ $? -eq 0 ] then - echo "$stat&$bumped" + if [ "$isMaster" = true ] ; then + state="Status: MASTER" + fi + echo "$state&$bumped" fi if [ $nolock -eq 0 ]