aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-07-26 01:43:47 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-07-26 01:43:47 +0000
commit17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac (patch)
tree15c6fa9bdc91aa03b04f1f29a956d126963533d1
parent0d27618adb7bd5fa4300a00921d69c1c6aae68fa (diff)
downloadinitscripts-17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac.tar
initscripts-17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac.tar.gz
initscripts-17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac.tar.bz2
initscripts-17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac.tar.xz
initscripts-17e3ac8cbb2a1baa012f2f26ed6b83f9ce769eac.zip
Oops, set $alias like the previous version did. Document this part of the
interface.
-rw-r--r--sysconfig/network-scripts/network-functions6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 310d9861..462d141c 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -195,21 +195,23 @@ rename_device()
}
}
+# Sets $alias to the device module if $? != 0
is_available ()
{
LC_ALL= LANG= ip -o link | grep -q $1
[ "$?" = "1" ] || return 0
- modprobe -c | awk \
+ alias=$(modprobe -c | awk \
'BEGIN { alias = ""; }
$1 == "alias" && $2 == "'"$1"'" { alias = $3; }
$1 == "install" { install[$2] = $3; }
END {
cmd = install[alias];
+ print alias;
if (alias == "" || alias == "off" || cmd == "/bin/true" || cmd == ":")
exit 1;
exit 0;
-}'
+}')
[ $? -eq 0 ] || return 2
modprobe $1 > /dev/null 2>&1 || {