Ticket #2315: lfs-bootscripts-20081031.patch

File lfs-bootscripts-20081031.patch, 945 bytes (added by Arthur Demchenkov, 16 years ago)

Prevents error messages ip writes if network device is already brought down

  • lfs/sysconfig/network-devices/ifdown

    Prevents error messages ip writes if network device is already brought down
    by service script.
    
    For example bridge interface needs to be down before removing.
    Unpatched bootscript writes this every time network goes down:
    Device "bri0" does not exist.
    
    Service files are attached as well.
    Feel free to move it to contribute if you wish.
    
    diff -Naur lfs-bootscripts-20081031/lfs/sysconfig/network-devices/ifdown lfs-bootscripts-20081031-new/lfs/sysconfig/network-devices/ifdown
    old new  
    8282done
    8383
    8484if [ -z "${2}" ]; then
    85         link_status=`ip link show $1`
     85        link_status=`ip link show $1 2>/dev/null`
    8686        if [ -n "${link_status}" ]; then
    8787                if echo "${link_status}" | grep -q UP; then
    8888                        boot_mesg "Bringing down the ${1} interface..."