From c48bf41abf55b5491b00b94fd2115dd6490d1aab Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 2 Apr 2001 21:06:37 +0000 Subject: handle aliases better in check_device_down (#18687) fix ARP handling, allow for setting promiscuous or all-multicast mode oops, put the LANG=C in the right place fix the adding default route if GATEWAY" = "0.0.0.0 --- sysconfig/network-scripts/network-functions | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sysconfig/network-scripts') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 8b726a83..1a43ffaf 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -17,6 +17,20 @@ source_config () . $CONFIG } +toggle_value() +{ + if [ -z "$2" ] + then + echo '' + elif [ "$2" = "yes" -o "$2" = "YES" ] ; then + echo "$1" + elif [ "$2" = "no" -o "$2" = "NO" ] ; then + echo "-$1" + else + echo '' + fi +} + do_netreport () { # Notify programs that have requested notification @@ -50,10 +64,18 @@ set_hostname() check_device_down () { - if ifconfig ${DEVICE} 2>/dev/null | LANG=C grep " UP " >/dev/null 2>&1 ; then + if echo ${DEVICE} | grep -q ':' ; then + if LANG=C ifconfig -a 2>/dev/null | grep -q ${DEVICE} ; then + retcode=1 + else + retcode=0 + fi + else + if LANG=C ifconfig ${DEVICE} 2>/dev/null | grep " UP " >/dev/null 2>&1 ; then retcode=1 - else + else retcode=0 + fi fi return $retcode } -- cgit