]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- use awk instead of sed in interface selection
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 6 Nov 2000 16:24:46 +0000 (16:24 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 6 Nov 2000 16:24:46 +0000 (16:24 +0000)
svn-id: @827

rc.d/init.d/network

index 08db591794b59f3bab0c351ad0597d5aba36ba50..75239555657fa993ce57a44f26b8d08230c4483e 100644 (file)
@@ -8,7 +8,7 @@
 #
 # probe:       true
 
-# $Id: network,v 1.38 2000/11/06 15:42:19 baggins Exp $
+# $Id: network,v 1.39 2000/11/06 16:24:46 baggins Exp $
 
 # NLS
 NLS_DOMAIN="rc-scripts"
@@ -138,23 +138,19 @@ proc_net ipv6/conf/default/autoconf_route $TODO 0 1 IPV6_AUTOCONF_ROUTE ""
 # find all the interfaces besides loopback.
 # ignore aliases, alternative configurations, and editor backup files
 
-interfaces="`(ls /etc/sysconfig/interfaces/ifcfg* | \
-egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
-sed 's!^/etc/sysconfig/interfaces/ifcfg-!!g') 2> /dev/null`"
-
-interfaces_boot="`(alias xx="ls /etc/sysconfig/interfaces/ifcfg* |\
-egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-lec|ifcfg-atm|:)' | egrep 'ifcfg-[a-z0-9]+$'" ; \
-for i in \`xx\`; do ONBOOT=""; . $i; if is_yes "$ONBOOT"; then \
-echo $i; fi; done | sed 's!^/etc/sysconfig/interfaces/ifcfg-!!g') 2> /dev/null`"
-
-interfaces_sit_boot="`(alias xx="ls /etc/sysconfig/interfaces/ifcfg-sit* | \
-egrep 'ifcfg-[a-z0-9]+$'"; for i in \`xx\`; do ONBOOT=""; . $i; \
-if is_yes "$ONBOOT"; then echo $i; fi; done | \
-sed 's!^/etc/sysconfig/interfaces/ifcfg-!!g') 2> /dev/null`"
-
-tunnels="`(alias xx="ls /etc/sysconfig/interfaces/tnlcfg-*"; \
-for i in \`xx\`; do ONBOOT=""; . $i; if is_yes "$ONBOOT"; then echo $i; \
-fi; done | sed 's!^/etc/sysconfig/interfaces/tnlcfg-!!g') 2> /dev/null`"
+interfaces=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
+       egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+interfaces_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
+       egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
+       xargs egrep -l "ONBOOT=[^n][^o]" | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+interfaces_sit_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg-sit* | \
+       egrep 'ifcfg-[a-z0-9]+$' | xargs egrep -l "ONBOOT=[^n][^o]" | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+tunnels=$((cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | \
+       xargs egrep -l "ONBOOT=[^n][^o]" | \
+       awk ' { gsub(/tnlcfg-/,NIL); print $0 } ') 2> /dev/null)
 
 # See how we were called.
 case "$1" in
This page took 0.125885 seconds and 4 git commands to generate.