aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup20
-rw-r--r--sysconfig/network-scripts/network-functions16
2 files changed, 24 insertions, 12 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 0ea87418..aec95481 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -85,18 +85,14 @@ if [ -x ${OTHERSCRIPT} ]; then
exec ${OTHERSCRIPT} ${CONFIG} $2
fi
-# is this device available? (this catches PCMCIA devices for us)
-LC_ALL= LANG= ip -o link | grep -q ${REALDEVICE}
-if [ "$?" = "1" ]; then
- alias=`modprobe -c | awk "/^alias ${REALDEVICE} / { print \\$3 }"`
- if [ -z "$alias" -o "$alias" = "off" ]; then
- exit 0
- fi
- modprobe $alias || {
- echo $"$alias device does not seem to be present, delaying ${DEVICE} initialization."
- exit 1
- }
-fi
+is_available ${REALDEVICE} || {
+ if [ "$?" = "1" ] ; then
+ echo $"$alias device does not seem to be present, delaying ${DEVICE} initialization."
+ exit 1
+ else
+ exit 0
+ fi
+}
if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 2f181d73..934f55ae 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -80,6 +80,22 @@ do_netreport ()
)
}
+is_available ()
+{
+ LC_ALL= LANG= ip -o link | grep -q $1
+ if [ "$?" = "1" ]; then
+ alias=`modprobe -c | awk "/^alias $1 / { print \\$3 }"`
+ if [ -z "$alias" -o "$alias" = "off" ]; then
+ return 2
+ fi
+ modprobe $alias >/dev/null 2>&1|| {
+ return 1
+ }
+ else
+ return 0
+ fi
+}
+
need_hostname()
{
if [ "`hostname`" = "(none)" -o "`hostname`" = "localhost" -o \