Olá lista :)

Estou tendo um resultado inesperado com este script ai, e nao sei como 
resolver...


#!/bin/bash
#
# Fri Nov 30 14:25:46 BRST 2007
#
#Teste de conexão
ping -q -c 2 200.160.2.3 -I eth1 > /dev/null  2>&1 && STATUS_LINK1="UP" 
|| STATUS_LINK1="DOWN"
ping -q -c 2 200.160.2.3 -I eth2 > /dev/null  2>&1 && STATUS_LINK2="UP" 
|| STATUS_LINK2="DOWN"

if [ $STATUS_LINK1 == DOWN ] && [ $STATUS_LINK2 == DOWN ] ; then

        echo "Ferrou!!! Os dois links estao fora do ar"

elseif [ $STATUS_LINK1 == UP ] && [ $STATUS_LINK2 == DOWN ]

        echo "Mudando rota para link1"

elseif [ $STATUS_LINK1 == DOWN ] && [ $STATUS_LINK2 == UP ]

        echo "Mudando rota para link2"

fi



$ /bin/sh -x redundancia.sh
+ ping -q -c 2 200.160.2.3 -I eth1
+ STATUS_LINK1=UP
+ ping -q -c 2 200.160.2.3 -I eth2
+ STATUS_LINK2=UP
+ '[' UP == DOWN ']'


Se alguem puder ajudar, e se possivel doar ideias para turbinar o script...


Fábio Gomes dos Santos

Responder a