]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Cache hostname output to call it less times
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 22 Jan 2007 18:16:11 +0000 (18:16 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 22 Jan 2007 18:16:11 +0000 (18:16 +0000)
svn-id: @8186

sysconfig/network-scripts/functions.network

index 0d3e77ead693080e26d795e7d1ed67f4c5c0a299..681c4233b8562f7fefc3125cd39a8950010d287f 100644 (file)
@@ -43,8 +43,9 @@ do_netreport ()
 
 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
This page took 0.188849 seconds and 4 git commands to generate.