CLOUDSTACK-8952 - Make the checkrouter.sh compatible with RVR as well

This commit is contained in:
Wilder Rodrigues 2015-10-17 14:48:08 +02:00
parent 38d03576d6
commit fb33cb28ab
2 changed files with 24 additions and 4 deletions

View File

@ -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}"

View File

@ -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}"