shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] interface ativa ou nao


From: Jeferson A. Cassol
Subject: Re: [shell-script] interface ativa ou nao
Date: Sat, 22 Jan 2005 14:18:57 -0200
User-agent: KMail/1.5.4

if [ `LANG=C ifconfig eth0 | grep RUNNING | wc -l` -ne 0 ]
then
  echo "Ativa"
else
  echo "Inativa"
fi




Em Sáb 22 Jan 2005 12:27, Luiz Antonio Oliveira escreveu:
> Estou rodando o seguinte script para saber se a interface esta ativa ou
> nao.. mas quando nao esta da um erro e nao executa...
>
> ps: tirem o cabo e testem para nao estar ativa. :P
>
> statuseth0=`ifconfig eth0 | grep RUNNING | cut -d " " -f13 >
> statuseth0.txt` conteth0=RUNNING
> verifeth0=`cat statuseth0.txt`
>
>
> if [ $verifeth0 == $conteth0 ]; then
>         echo "Está Ativo"
> fi
> if [ $verifeth0 != $conteth0 ]; then
>      echo "Não Esta Ativo"
> fi
>
>    abraços [']sss



reply via email to

[Prev in Thread] Current Thread [Next in Thread]