aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/network
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-10 19:57:37 +0100
committerColin Guthrie <colin@mageia.org>2012-04-10 19:57:37 +0100
commited4b0ecc3087b2f509077075b24fb942a5834ca1 (patch)
tree6cad841c32cb15f7709742ed5b3f2a33895f3d15 /rc.d/init.d/network
parentf27c7d383b1e8c5a95fa797c925e8cc5d6a46275 (diff)
downloadinitscripts-ed4b0ecc3087b2f509077075b24fb942a5834ca1.tar
initscripts-ed4b0ecc3087b2f509077075b24fb942a5834ca1.tar.gz
initscripts-ed4b0ecc3087b2f509077075b24fb942a5834ca1.tar.bz2
initscripts-ed4b0ecc3087b2f509077075b24fb942a5834ca1.tar.xz
initscripts-ed4b0ecc3087b2f509077075b24fb942a5834ca1.zip
network: Deal with ifcfg-* file that have spaces in them.
This can happen on the ifcfg-Auto* files created by NM. It may be more sensible overall to just skip such files, but incase any other invalid files are found, they are now simply skipped to avoid errors.
Diffstat (limited to 'rc.d/init.d/network')
-rwxr-xr-xrc.d/init.d/network21
1 files changed, 11 insertions, 10 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index b7d521c9..e9d22dd7 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -51,9 +51,10 @@ cd /etc/sysconfig/network-scripts
interfaces=$(/bin/ls ifcfg* | \
LC_ALL=C sed -e "$__sed_discard_ignored_files" \
-e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \
- -e '/ifcfg-[A-Za-z0-9#\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \
+ -e '/ifcfg-[ A-Za-z0-9#\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \
+ LC_ALL=C grep -v '^ifcfg-' | \
LC_ALL=C sort -k 1,1 -k 2n | \
- LC_ALL=C sed 's/ //')
+ LC_ALL=C sed -e 's/ \([0-9]\)/\1/')
rc=0
# See how we were called.
@@ -126,9 +127,9 @@ case "$1" in
# bring up all other interfaces configured to come up at boot time
for i in $interfaces; do
unset DEVICE TYPE SLAVE
- eval $(LANG=C grep -F "DEVICE=" ifcfg-$i)
- eval $(LANG=C grep -F "TYPE=" ifcfg-$i)
- eval $(LANG=C grep -F "SLAVE=" ifcfg-$i)
+ eval $(LANG=C grep -F "DEVICE=" "ifcfg-$i")
+ eval $(LANG=C grep -F "TYPE=" "ifcfg-$i")
+ eval $(LANG=C grep -F "SLAVE=" "ifcfg-$i")
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
@@ -162,7 +163,7 @@ case "$1" in
continue
fi
- if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
+ if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" "ifcfg-$i" > /dev/null ; then
# this loads the module, to preserve ordering
is_available $i
continue
@@ -189,7 +190,7 @@ case "$1" in
# Bring up xDSL and VPN interfaces
for i in $vlaninterfaces $bridgeinterfaces $xdslinterfaces $vpninterfaces ; do
- if ! LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then
+ if ! LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" "ifcfg-$i" >/dev/null 2>&1 ; then
# If we're in confirmation mode, get user confirmation.
if [ -f /var/run/confirm ]; then
confirm $i
@@ -248,8 +249,8 @@ case "$1" in
# get list of bonding, vpn, and xdsl interfaces
for i in $interfaces; do
unset DEVICE TYPE
- eval $(LANG=C grep -F "DEVICE=" ifcfg-$i)
- eval $(LANG=C grep -F "TYPE=" ifcfg-$i)
+ eval $(LANG=C grep -F "DEVICE=" "ifcfg-$i")
+ eval $(LANG=C grep -F "TYPE=" "ifcfg-$i")
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
@@ -282,7 +283,7 @@ case "$1" in
done
for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
- (. ./ifcfg-$i
+ (. "./ifcfg-$i"
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
if ! check_device_down $DEVICE; then