mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Create getDefaultNetOpts()
This commit is contained in:
@@ -29,27 +29,6 @@ function cidr2mask($cidr)
|
||||
return join ('.', $netmask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a dhcp default config header
|
||||
*
|
||||
* @return array $config
|
||||
*/
|
||||
function defaultHeader()
|
||||
{
|
||||
$config = [ '# RaspAP default configuration' ];
|
||||
$config[] = 'hostname';
|
||||
$config[] = 'clientid';
|
||||
$config[] = 'persistent';
|
||||
$config[] = 'option rapid_commit';
|
||||
$config[] = 'option domain_name_servers, domain_name, domain_search, host_name';
|
||||
$config[] = 'option classless_static_routes';
|
||||
$config[] = 'option ntp_servers';
|
||||
$config[] = 'require dhcp_server_identifier';
|
||||
$config[] = 'slaac private';
|
||||
$config[] = 'nohook lookup-hostname';
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a dhcp configuration block for the specified interface
|
||||
*
|
||||
@@ -139,6 +118,22 @@ function getDefaultNetValue($svc,$iface,$key)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns default options for the specified service
|
||||
*
|
||||
* @param string $svc
|
||||
* @return object $json
|
||||
*/
|
||||
function getDefaultNetOpts($svc)
|
||||
{
|
||||
$json = json_decode(file_get_contents(RASPI_CONFIG_NETWORK), true);
|
||||
if ($json === null) {
|
||||
return false;
|
||||
} else {
|
||||
return $json[$svc]['options'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to write ini files */
|
||||
|
||||
function write_php_ini($array, $file)
|
||||
|
Reference in New Issue
Block a user