Fix for bug #12050

Message ID trinity-36f502c3-84a2-474b-ba7f-3a0d2b4a8c82-1558705439610@3c-app-gmx-bs42
State Superseded
Headers
Series Fix for bug #12050 |

Commit Message

Bernhard Bitsch May 24, 2019, 11:43 p.m. UTC
  Save fixed leases to file after addition of a new lease

Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org>

---
 html/cgi-bin/dhcp.cgi | 3 +++
 1 file changed, 3 insertions(+)

--
2.21.0.windows.1
  

Patch

diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi
index 675d80012..19c55eb6d 100644
--- a/html/cgi-bin/dhcp.cgi
+++ b/html/cgi-bin/dhcp.cgi
@@ -443,6 +443,9 @@  if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') {
 	$dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'});
 	if ($dhcpsettings{'KEY2'} eq '') { #add or edit ?
 	    unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n");
+	    open(FILE, ">$filename2") or die 'Unable to open fixed lease file.';
+	    print FILE @current2;
+	    close(FILE);
 	    &General::log($Lang::tr{'fixed ip lease added'});

 	    # Enter edit mode