Author: glen
Date: Mon Jan 22 19:09:46 2007
New Revision: 8185

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Less subshells in source_config().

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network        
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network        Mon Jan 
22 19:09:46 2007
@@ -7,9 +7,9 @@
 
 source_config ()
 {
-       DEVNAME=$(basename "$CONFIG" | awk ' { gsub(/^ifcfg-/,NIL); print $0; } 
')
+       DEVNAME=${CONFIG##*/ifcfg-}
 
-       if echo "$CONFIG"|egrep "^/" >/dev/null 2>&1 ; then
+       if [[ "$CONFIG" = /* ]]; then
                if [ -f "$CONFIG" ] ; then
                        . "$CONFIG"
                fi
@@ -25,7 +25,7 @@
                exit 1
        fi
 
-       if [ -n "${PREFIX}" ] && ! $(echo $IPADDR | grep "/" 2>&1 >/dev/null) ; 
then
+       if [ -n "${PREFIX}" ] && [[ "$IPADDR" != */* ]]; then
                IPADDR="$IPADDR/$PREFIX"
        fi
 }
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to