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

Re: find if eth0 up



Here is the script ... Enjoy

#!/bin/bash

IFCONFIG="/sbin/ifconfig $1"

ISIT=`$IFCONFIG | grep "UP" | wc -l`;

if test $ISIT -gt 0;
 then
  echo "Yup ... $1 is up!";
else
  echo "Nope ... No $1 or it'sn't up!";
fi


TODO : 

Add a checker. You need one argument which is the device you're looking
for.
Suppress the error message if no device is present in the system.




On Thu, 9 May 2002, Rory Campbell-Lange wrote:

> I'm trying to clarify my own question:
> 
> What is the easiest way in bash to find if eth0 is up?
> 
> Thanks
> Rory
> 
> 

-- 
Jean-Francois Gobin - Administrateur gobinjf.be
http://www.gobinjf.be   mailto:gobin@gobinjf.be


-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: