SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network
    glen 
    glen at pld-linux.org
       
    Mon Jan 22 19:16:11 CET 2007
    
    
  
Author: glen
Date: Mon Jan 22 19:16:11 2007
New Revision: 8186
Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Cache hostname output to call it less times
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:16:11 2007
@@ -43,8 +43,9 @@
 
 need_hostname()
 {
-	if [ "`hostname`" = "(none)" -o "`hostname`" = "localhost" -o \
-	     "`hostname`" = "localhost.localdomain" ]; then
+	local hostname=$(hostname)
+	if [ "$hostname" = "(none)" -o "$hostname" = "localhost" -o \
+	     "$hostname" = "localhost.localdomain" ]; then
 		NEEDHOSTNAME=yes
 	else
 		unset NEEDHOSTNAME
    
    
More information about the pld-cvs-commit
mailing list