Code

Updated DHCP host-name entry if host was renamed!
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Oct 2009 12:39:35 +0000 (12:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Oct 2009 12:39:35 +0000 (12:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14480 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_termDNS.inc

index 62d6f6890ad2869ddc9922669a66e36c3a4ba5fd..4ceb6fbcb486c0437c95d8e1776d295f1e6497dd 100644 (file)
@@ -750,6 +750,15 @@ class termDNS extends plugin
         if(count($this->dhcpHostEntry['dhcpOption']) == 0){
           $this->dhcpHostEntry['dhcpOption']= array("host-name ".$this->cn);
         }
+      }else{
+
+        // Updated Host-Name entry 
+        foreach($this->dhcpHostEntry['dhcpOption'] as $key => $entry){
+          if(preg_match("/^host-name/", $entry)){
+            $this->dhcpHostEntry['dhcpOption'][$key] = "host-name ".$this->cn;
+            break;
+          }
+        }
       }
 
       /* Write mac address to dhcp settings */