From: hickert Date: Fri, 2 Oct 2009 12:39:35 +0000 (+0000) Subject: Updated DHCP host-name entry if host was renamed! X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9a1cf2f38b5b9a00327fba260d59d8e649d5ecf5;p=gosa.git Updated DHCP host-name entry if host was renamed! git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14480 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 62d6f6890..4ceb6fbcb 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -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 */