mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Added getDefaultNetValue()
This commit is contained in:
parent
e77b0fead1
commit
9f85daaa86
1 changed files with 18 additions and 0 deletions
|
@ -121,6 +121,24 @@ function scanConfigDir($dir_conf,$interface,$status)
|
|||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a default (fallback) value for the selected service, interface & setting
|
||||
* from /etc/raspap/networking/defaults.json
|
||||
*
|
||||
* @param string $svc
|
||||
* @param string $iface
|
||||
* @return string $value
|
||||
*/
|
||||
function getDefaultNetValue($svc,$iface,$key)
|
||||
{
|
||||
$json = json_decode(file_get_contents(RASPI_CONFIG_NETWORK), true);
|
||||
if ($json === null) {
|
||||
return false;
|
||||
} else {
|
||||
return $json[$svc][$iface][$key][0];
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to write ini files */
|
||||
|
||||
function write_php_ini($array, $file)
|
||||
|
|
Loading…
Reference in a new issue