From 9a1cf2f38b5b9a00327fba260d59d8e649d5ecf5 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Oct 2009 12:39:35 +0000 Subject: [PATCH] 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 --- gosa-plugins/systems/admin/systems/class_termDNS.inc | 9 +++++++++ 1 file changed, 9 insertions(+) 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 */ -- 2.30.2