Commit 85dd1473 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) please set interface flag one by one....

parent 47b56236
...@@ -50,10 +50,12 @@ function legacy_interface_listget($flag = '') ...@@ -50,10 +50,12 @@ function legacy_interface_listget($flag = '')
return ($ifs); return ($ifs);
} }
function legacy_interface_flags($ifs, $flag, $report_errors=true) function legacy_interface_flags($ifs, $flags, $report_errors=true)
{ {
/* $flags isn't escaped because it can be an argument list */ /* $flags isn't escaped because it can be an argument list */
$cmd = '/sbin/ifconfig ' . escapeshellarg($ifs) . ' ' . $flag; foreach (explode(' ', $flags) as $flag) {
$cmd = '/sbin/ifconfig ' . escapeshellarg($ifs) . ' ' . $flag;
}
exec($cmd . ' 2>&1', $out, $ret); exec($cmd . ' 2>&1', $out, $ret);
if (!empty($ret) && $report_errors) { if (!empty($ret) && $report_errors) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment