mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
interfaces: safeguard some shell_exec() callouts in case parameter isn't provided, also omits "Passing null to parameter" messages in debug log
This commit is contained in:
parent
c65dff5f0e
commit
7e0fa15982
@ -3886,9 +3886,11 @@ function get_interfaces_info($include_unlinked = false)
|
||||
}
|
||||
}
|
||||
|
||||
$aux = trim(shell_exec(exec_safe('/usr/local/sbin/ifctl -6pi %s', $ifinfo['ifv6'])));
|
||||
if (!empty($aux)) {
|
||||
$ifinfo['prefixv6'] = $aux;
|
||||
if (!empty($ifinfo['ifv6'])) {
|
||||
$aux = trim(shell_exec(exec_safe('/usr/local/sbin/ifctl -6pi %s', $ifinfo['ifv6'])));
|
||||
if (!empty($aux)) {
|
||||
$ifinfo['prefixv6'] = $aux;
|
||||
}
|
||||
}
|
||||
|
||||
$ifinfotmp = $all_intf_stats[$ifinfo['if']];
|
||||
@ -3953,7 +3955,7 @@ function get_interfaces_info($include_unlinked = false)
|
||||
break;
|
||||
}
|
||||
|
||||
if (file_exists("/var/run/{$link_type}_{$ifdescr}.pid")) {
|
||||
if (file_exists("/var/run/{$link_type}_{$ifdescr}.pid") && !empty($ifinfo['if'])) {
|
||||
$sec = intval(trim(shell_exec('/usr/local/opnsense/scripts/interfaces/ppp-uptime.sh ' . escapeshellarg($ifinfo['if']))));
|
||||
if ($sec) {
|
||||
$ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user