add 'default route' toggle to network interface configuration ui

This commit is contained in:
glaszig
2021-04-03 00:43:42 +01:00
parent 8f0ae3b36a
commit 6196bcd311
4 changed files with 16 additions and 0 deletions

View File

@@ -244,6 +244,7 @@ function updateDHCPConfig($iface,$status)
$cfg[] = 'profile static_'.$iface;
$cfg[] = 'fallback static_'.$iface;
}
$cfg[] = $_POST['DefaultRoute'] == '1' ? 'gateway' : 'nogateway';
$dhcp_cfg = file_get_contents(RASPI_DHCPCD_CONFIG);
if (!preg_match('/^interface\s'.$iface.'$/m', $dhcp_cfg)) {
$cfg[] = PHP_EOL;