mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Add dhcp-ignore handling
This commit is contained in:
		| @@ -45,12 +45,15 @@ function DisplayDHCPConfig() | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     getWifiInterface(); |     getWifiInterface(); | ||||||
|  |     $ap_iface = $_SESSION['ap_interface']; | ||||||
|     $serviceStatus = $dnsmasq_state ? "up" : "down"; |     $serviceStatus = $dnsmasq_state ? "up" : "down"; | ||||||
|     exec('cat '. RASPI_DNSMASQ_PREFIX.'raspap.conf', $return); |     exec('cat '. RASPI_DNSMASQ_PREFIX.'raspap.conf', $return); | ||||||
|     $conf = ParseConfig($return); |     $conf = ParseConfig($return); | ||||||
|  |     exec('cat '. RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return); | ||||||
|  |     $conf = array_merge(ParseConfig($return)); | ||||||
|  |     $hosts = (array)$conf['dhcp-host']; | ||||||
|     exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces); |     exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces); | ||||||
|     exec('cat ' . RASPI_DNSMASQ_LEASES, $leases); |     exec('cat ' . RASPI_DNSMASQ_LEASES, $leases); | ||||||
|     $ap_iface = $_SESSION['ap_interface']; |  | ||||||
|  |  | ||||||
|     echo renderTemplate( |     echo renderTemplate( | ||||||
|         "dhcp", compact( |         "dhcp", compact( | ||||||
| @@ -59,7 +62,7 @@ function DisplayDHCPConfig() | |||||||
|             "dnsmasq_state", |             "dnsmasq_state", | ||||||
|             "ap_iface", |             "ap_iface", | ||||||
|             "conf", |             "conf", | ||||||
|             "dhcpHost", |             "hosts", | ||||||
|             "interfaces", |             "interfaces", | ||||||
|             "leases" |             "leases" | ||||||
|         ) |         ) | ||||||
| @@ -188,6 +191,9 @@ function updateDnsmasqConfig($iface,$status) | |||||||
|         } |         } | ||||||
|         $config .= PHP_EOL; |         $config .= PHP_EOL; | ||||||
|     } |     } | ||||||
|  |     if ($_POST['dhcp-ignore'] == "1") { | ||||||
|  |         $config .= 'dhcp-ignore=tag:!known'.PHP_EOL; | ||||||
|  |     } | ||||||
|     file_put_contents("/tmp/dnsmasqdata", $config); |     file_put_contents("/tmp/dnsmasqdata", $config); | ||||||
|     $msg = file_exists(RASPI_DNSMASQ_PREFIX.$iface.'.conf') ? 'updated' : 'added'; |     $msg = file_exists(RASPI_DNSMASQ_PREFIX.$iface.'.conf') ? 'updated' : 'added'; | ||||||
|     system('sudo cp /tmp/dnsmasqdata '.RASPI_DNSMASQ_PREFIX.$iface.'.conf', $result); |     system('sudo cp /tmp/dnsmasqdata '.RASPI_DNSMASQ_PREFIX.$iface.'.conf', $result); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user