[BLFS Trac] #2185: Check carrier status in DHCP client scripts

BLFS Trac trac at linuxfromscratch.org
Tue Aug 21 22:21:35 PDT 2007

#2185: Check carrier status in DHCP client scripts
 Reporter:  dnicholson at linuxfromscratch.org  |        Owner:  dnicholson at linuxfromscratch.org
     Type:  enhancement                      |       Status:  assigned                       
 Priority:  normal                           |    Milestone:  future                         
Component:  BOOK                             |      Version:  SVN                            
 Severity:  normal                           |   Resolution:                                 
 Keywords:  network                          |  
Comment (by dj at linuxfromscratch.org):

 What is the status on this one?  Seems a fairly simple modification as
 long as the /sys method tests reliably on several devices.  Actually, come
 to think of it, this should probably be done in the ifup script in LFS.
 I'm not sure if this would affect Bruce's wireless scripts however.  It'd
 have to wait until after the 6.3 release, but this or something similar
 looks well in my ifup (pardon the fake diff):

 +            # Only process the config file if the device is actually
 +            # to media.
 +            if [ "`cat /sys/class/net/${1}/carrier`" = 1 ]
 +            then
 -            IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1}
 +                IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE}
 ${1} up
 +            else
 +                echo -e "${WARNING}     The ${1} device has no
 +                echo -en "${CURS_UP}"
 +                log_warning_msg
 +            fi

Ticket URL: <http://wiki.linuxfromscratch.org/blfs/ticket/2185#comment:3>
BLFS Trac <http://wiki.linuxfromscratch.org/blfs>
Beyond Linux From Scratch

More information about the blfs-book mailing list