mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
interfaces: tried keys before but list() is too dense
This commit is contained in:
parent
db5c43d106
commit
2a6845a6fb
@ -4394,8 +4394,7 @@ function interfaces_primary_address($interface, $ifconfig_details = null)
|
||||
break; /* all done */
|
||||
}
|
||||
|
||||
/* DO NOT REORDER */
|
||||
return [ 'address' => $ifcfgip, 'network' => $network, 'bits' => $subnetbits, 'device' => $device ];
|
||||
return [ $ifcfgip, $network, $subnetbits, $device ];
|
||||
}
|
||||
|
||||
function _interfaces_primary_address6($interface, $ifconfig_details = null, $allow_track = true, $link_local = false)
|
||||
|
||||
@ -162,7 +162,14 @@ if (isset($opts['h'])) {
|
||||
echo "\t-S service metadata dump\n";
|
||||
echo "\t-s service mode (e.g. myservice restart)\n";
|
||||
} elseif (isset($opts['4'])) {
|
||||
echo json_encode(interfaces_primary_address($args[0] ?? null), JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT) . PHP_EOL;
|
||||
$raw = interfaces_primary_address($args[0] ?? null);
|
||||
$ret = [
|
||||
'address' => $raw[0],
|
||||
'network' => $raw[1],
|
||||
'bits' => $raw[2],
|
||||
'device' => $raw[3],
|
||||
];
|
||||
echo json_encode($ret, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT) . PHP_EOL;
|
||||
} elseif (isset($opts['D'])) {
|
||||
echo json_encode(legacy_interfaces_details($args[0] ?? null), JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT) . PHP_EOL;
|
||||
} elseif (isset($opts['d'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user