]> git.pld-linux.org Git - packages/rc-scripts.git/blame - rc-scripts-branch.patch
- outdated
[packages/rc-scripts.git] / rc-scripts-branch.patch
CommitLineData
50a9015e
ER
1Index: rc.d/init.d/network
2===================================================================
3--- rc.d/init.d/network (revision 7128)
4+++ rc.d/init.d/network (revision 7131)
5@@ -119,74 +119,98 @@
6 set_down_loopback
7 }
8
9-# find all the interfaces besides loopback.
10-# ignore aliases, alternative configurations, and editor backup files
11-if [ -n "$(grep "^BOOTPRIO=" /etc/sysconfig/interfaces/ifcfg* 2> /dev/null)" ]; then
12- interfaces_boot=$(( \
13- . /etc/rc.d/init.d/functions; \
14- cd /etc/sysconfig/interfaces; \
15- egrep 'BOOTPRIO' ifcfg* | sort -t= -n -k2,2 | \
16- awk ' { gsub(/:BOOTPRIO.*/,NIL); print $0 } '| egrep -v 'ifcfg-lo' | \
17- for i in `cat`; do \
18- ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; \
19- is_yes "$ONBOOT" && echo "$i"; \
20- done | \
21- awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
22+# Get list of interface configs
23+# ignores editor backup files and rpm blackups
24+network_interface_configs()
25+{
26+ local match="$1"
27+ for a in /etc/sysconfig/interfaces/$match; do
28+ case "$a" in
29+ *rpmorig|*rpmnew|*rpmsave|*~|*.orig)
30+ continue
31+ ;;
32+ *)
33+ echo $a
34+ ;;
35+ esac
36+ done
37+}
38+
39+ifcfg_files="$(network_interface_configs 'ifcfg-*')"
40+
41+if [ -n "$bootprio" ]; then
42+ # find all the interfaces besides loopback.
43+ interfaces_boot=`
44+ for a in $(echo "$bootprio" | sort -t= -n -k2,2); do
45+ i="${a%:BOOTPRIO*}"
46+ case $i in
47+ *ifcfg-lo) continue ;;
48+ esac
49+ ONBOOT=""; . "$i" 2>/dev/null
50+ is_yes "$ONBOOT" && echo "${i##*/}"
51+ done
52+ `
53 else
54- interfaces_boot=$((
55- . /etc/rc.d/init.d/functions; \
56- cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
57- egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|ifcfg-nas|ifcfg-br|ifcfg-(.*)\.(.*))' | \
58- LC_ALL=C egrep 'ifcfg-[a-z0-9\.]+$' | \
59- for i in `cat`; do \
60- ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; \
61- is_yes "$ONBOOT" && echo "$i"; \
62- done | \
63- awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
64- interfaces_vlan_boot=$((
65- . /etc/rc.d/init.d/functions; \
66- cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
67- egrep 'ifcfg-(.*)\.(.*)' | \
68- LC_ALL=C egrep 'ifcfg-[a-z0-9\.]+$' | \
69- for i in `cat`; do \
70- ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; \
71- is_yes "$ONBOOT" && echo "$i"; \
72- done | \
73- awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
74- interfaces_br_boot=$((
75- . /etc/rc.d/init.d/functions; \
76- cd /etc/sysconfig/interfaces && ls -1 ifcfg-br* | \
77- LC_ALL=C egrep 'ifcfg-[a-z0-9\.]+$' | \
78- for i in `cat`; do \
79- ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; \
80- is_yes "$ONBOOT" && echo "$i"; \
81- done | \
82- awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
83- interfaces_sit_boot=$((
84- . /etc/rc.d/init.d/functions; \
85- cd /etc/sysconfig/interfaces && ls -1 ifcfg-sit* | \
86- LC_ALL=C egrep 'ifcfg-[a-z0-9]+$' | \
87- for i in `cat`; do \
88- ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; \
89- is_yes "$ONBOOT" && echo "$i"; \
90- done | \
91- awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
92+ interfaces_boot=`
93+ for i in $ifcfg_files; do
94+ case ${i##*/} in
95+ ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|ifcfg-nas|ifcfg-br|ifcfg-*.*) continue ;;
96+ esac
97+ ONBOOT=""; . "$i" 2>/dev/null
98+ is_yes "$ONBOOT" && echo "${i##*/}"
99+ done
100+ `
101+
102+ interfaces_vlan_boot=`
103+ for i in $ifcfg_files; do
104+ case ${i##*/} in
105+ ifcfg-*.*) ;;
106+ *) continue ;;
107+ esac
108+ ONBOOT=""; . "$i" 2>/dev/null
109+ is_yes "$ONBOOT" && echo "${i##*/}"
110+ done
111+ `
112+
113+ interfaces_br_boot=`
114+ for i in $ifcfg_files; do
115+ case ${i##*/} in
116+ ifcfg-br*) ;;
117+ *) continue ;;
118+ esac
119+ ONBOOT=""; . "$i" 2>/dev/null
120+ is_yes "$ONBOOT" && echo "${i##*/}"
121+ done
122+ `
123+
124+ interfaces_sit_boot=`
125+ for i in $ifcfg_files; do
126+ case ${i##*/} in
127+ ifcfg-sit*) ;;
128+ *) continue ;;
129+ esac
130+ ONBOOT=""; . "$i" 2>/dev/null
131+ is_yes "$ONBOOT" && echo "${i##*/}"
132+ done
133+ `
134 fi
135-tunnels=$((cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | \
136- xargs egrep -l "ONBOOT=[^n][^o]" | \
137- LC_ALL=C egrep 'tnlcfg-[a-z0-9]+$' | \
138- awk ' { gsub(/tnlcfg-/,NIL); print $0 } ') 2> /dev/null)
139
140+tunnels=`
141+ for i in $(network_interface_configs 'tnlcfg-*'); do
142+ ONBOOT=""; . "$i" 2>/dev/null
143+ is_yes "$ONBOOT" && echo "${i##*/}"
144+ done
145+`
146+
147 # See how we were called.
148 case "$1" in
149 start)
150- rc_splash "bootnetwork start"
151-
152 if is_yes "$VSERVER"; then
153 touch /var/lock/subsys/network
154 exit 0
155 fi
156
157+ rc_splash "bootnetwork start"
158 network_init
159
160 for i in $interfaces_boot $interfaces_vlan_boot $interfaces_sit_boot ; do
This page took 0.230903 seconds and 4 git commands to generate.