_command->getData(); $args = [ 'wakeonlan', '-i', $data['IP'], '-p', $data['Port'] ]; foreach ($data["MACs"] as $mac) { $args[] = $mac; } $cli = implode(' ', $args); $code = 0; $output = []; exec($cli, $output, $code); if ($code != 0) { abort(500, "Wakeonlan failed with code " . $code); } } }