From 57bc3cfa3e05ca7efecdc280e8c6ca353e9822e2 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Wed, 9 Dec 2009 17:02:35 +0100 Subject: Files in sync with release --- config/Fit123/bin/date/index.abc | 23 +++-------- config/Fit123/bin/dnssrv/system.abc | 10 ++--- config/Fit123/bin/ltsp/services.inc | 16 +++++--- config/Fit123/bin/ltsp/services_dhcp.abc | 66 +++++++++++++++++++++++++++++--- 4 files changed, 80 insertions(+), 35 deletions(-) mode change 100644 => 100755 config/Fit123/bin/date/index.abc mode change 100644 => 100755 config/Fit123/bin/ltsp/services_dhcp.abc (limited to 'config') diff --git a/config/Fit123/bin/date/index.abc b/config/Fit123/bin/date/index.abc old mode 100644 new mode 100755 index 73a81fa1..f63b7001 --- a/config/Fit123/bin/date/index.abc +++ b/config/Fit123/bin/date/index.abc @@ -170,10 +170,12 @@ $currentDate = $dateOutput[0]; built on + - Platform / Current Date - / + Platform / Current Date + / + Hardware crypto @@ -230,23 +232,10 @@ $currentDate = $dateOutput[0]; SWAP usage - + left barred bargray barright bar   - - - - - - - Temperature - - - /images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" />/images/misc/bar_blue.gif" height="15" name="tempwidtha" id="tempwidtha" width="" border="0" align="middle" alt="red bar" />/images/misc/bar_gray.gif" height="15" name="tempwidthb" id="tempwidthb" width="" border="0" align="middle" alt="gray bar" />/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /> -   - " /> + diff --git a/config/Fit123/bin/dnssrv/system.abc b/config/Fit123/bin/dnssrv/system.abc index 5f3bf59d..898505b9 100755 --- a/config/Fit123/bin/dnssrv/system.abc +++ b/config/Fit123/bin/dnssrv/system.abc @@ -30,8 +30,6 @@ */ require("guiconfig.inc"); -if(!function_exists("filter_configure")) - require_once("filter.inc"); $pconfig['hostname'] = $config['system']['hostname']; $pconfig['domain'] = $config['system']['domain']; @@ -145,10 +143,10 @@ if ($_POST) { $config['system']['dnsserver'][] = $_POST['dns1']; if ($_POST['dns2']) $config['system']['dnsserver'][] = $_POST['dns2']; - if ($_POST['dns3']) - $config['system']['dnsserver'][] = $_POST['dns3']; - if ($_POST['dns4']) - $config['system']['dnsserver'][] = $_POST['dns4']; + if ($_POST['dns3']) + $config['system']['dnsserver'][] = $_POST['dns3']; + if ($_POST['dns4']) + $config['system']['dnsserver'][] = $_POST['dns4']; $olddnsallowoverride = $config['system']['dnsallowoverride']; diff --git a/config/Fit123/bin/ltsp/services.inc b/config/Fit123/bin/ltsp/services.inc index a788a2b3..f999868a 100644 --- a/config/Fit123/bin/ltsp/services.inc +++ b/config/Fit123/bin/ltsp/services.inc @@ -61,6 +61,7 @@ function services_dhcpd_configure() { fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/etc\n"); fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n"); fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/run\n"); fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n"); fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n"); fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n"); @@ -278,9 +279,9 @@ EOD; $dhcpdconf .= " next-server {$dhcpifconf['next-server']};\n"; $dhcpdconf .= " filename \"{$dhcpifconf['filename']}\";\n"; } - if ($dhcpifconf['rootpath'] <> "") { - $dhcpdconf .= " option root-path \"{$dhcpifconf['rootpath']}\";\n"; - } + if ($dhcpifconf['rootpath'] <> "") { + $dhcpdconf .= " option root-path \"{$dhcpifconf['rootpath']}\";\n"; + } } $dhcpdconf .= << $ifarr) + if (is_array($config['dhcpd'][$ifname]['staticmap'])) + foreach($config['dhcpd'][$ifname]['staticmap'] as $static) + $staticmacs[] = $static['mac']; + /* Read existing leases */ + $leases_contents = explode("\n", file_get_contents($leasesfile)); + $newleases_contents = array(); + $i=0; + while ($i < count($leases_contents)) { + /* Find a lease definition */ + if (substr($leases_contents[$i], 0, 6) == "lease ") { + $templease = array(); + $thismac = ""; + /* Read to the end of the lease declaration */ + do { + if (substr($leases_contents[$i], 0, 20) == " hardware ethernet ") + $thismac = substr($leases_contents[$i], 20, 17); + $templease[] = $leases_contents[$i]; + $i++; + } while ($leases_contents[$i-1] != "}"); + /* Check for a matching MAC address and if not present, keep it. */ + if (! in_array($thismac, $staticmacs)) + $newleases_contents = array_merge($newleases_contents, $templease); + } else { + /* It's a line we want to keep, copy it over. */ + $newleases_contents[] = $leases_contents[$i]; + $i++; + } + } + /* Write out the new leases file */ + $fd = fopen($leasesfile, 'w'); + fwrite($fd, implode("\n", $newleases_contents)); + fclose($fd); +} + $if = $_GET['if']; if ($_POST['if']) $if = $_POST['if']; @@ -225,7 +276,7 @@ if ($_POST) { $config['dhcpd'][$if]['netboot'] = ($_POST['netboot']) ? true : false; $config['dhcpd'][$if]['next-server'] = $_POST['nextserver']; $config['dhcpd'][$if]['filename'] = $_POST['filename']; - $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath']; + $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath']; write_config(); @@ -236,6 +287,9 @@ if ($_POST) { $retvaldhcp = 0; $retvaldns = 0; config_lock(); + /* Stop DHCP so we can cleanup leases */ + killbyname("dhcpd"); + dhcp_clean_leases(); /* dnsmasq_configure calls dhcpd_configure */ /* no need to restart dhcpd twice */ if (isset($config['dnsmasq']['regdhcpstatic'])) { @@ -302,7 +356,7 @@ function enable_change(enable_over) { document.iform.netboot.disabled = endis; document.iform.nextserver.disabled = endis; document.iform.filename.disabled = endis; - document.iform.rootpath.disabled = endis; + document.iform.rootpath.disabled = endis; document.iform.denyunknown.disabled = endis; } @@ -544,10 +598,10 @@ function show_netboot_config() {


Enter the filename used for network booting.
- Note: You need both a filename and a boot server configured for this to work!
-

-
- Enter option root-path. + Note: You need both a filename and a boot server configured for this to work!
+

+
+ Enter option root-path. -- cgit v1.2.3