mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 13:40:39 +01:00
Add
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@56 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
098099929e
commit
0a931cf1c5
1 changed files with 61 additions and 0 deletions
61
src/NMLoadModules
Executable file
61
src/NMLoadModules
Executable file
|
|
@ -0,0 +1,61 @@
|
|||
#! /bin/bash
|
||||
# Load kernel modules for all network devices
|
||||
|
||||
CWD=`pwd`
|
||||
cd /etc/sysconfig/network-scripts
|
||||
|
||||
# find all the interfaces besides loopback.
|
||||
# ignore aliases, alternative configurations, and editor backup files
|
||||
interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
|
||||
LANG=C egrep -v '(~|\.bak)$' | \
|
||||
LANG=C egrep 'ifcfg-[A-Za-z0-9\._-]+$' | \
|
||||
sed 's/^ifcfg-//g' |
|
||||
sed 's/[0-9]/ &/' | LANG=C sort -k 1,1 -k 2n | sed 's/ //'`
|
||||
|
||||
# bring up all other interfaces configured to come up at boot time
|
||||
for i in $interfaces; do
|
||||
eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
|
||||
eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
|
||||
eval $(LANG=C fgrep "SLAVE=" ifcfg-$i)
|
||||
eval $(LANG=C fgrep "BRIDGE=" ifcfg-$i)
|
||||
|
||||
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
|
||||
|
||||
if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "xDSL" ]; then
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -n "$BRIDGE" ]; then
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$SLAVE" = "yes" ]; then
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
continue
|
||||
fi
|
||||
unset DEVICE TYPE SLAVE BRIDGE
|
||||
|
||||
# Load the module
|
||||
LC_ALL= LANG= ip -o link | grep -q $i
|
||||
if [ "$?" = "1" ]; then
|
||||
alias=`modprobe -c | awk "/^(alias|install)[[:space:]]+$i[[:space:]]/ { print \\$3 }"`
|
||||
if [ -n "$alias" -a "$alias" != "off" -a "$alias" != "/bin/true" ]; then
|
||||
modprobe $alias > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
continue
|
||||
done
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Reference in a new issue