Se colocaran ejercios para practicar de codigobit
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
1 год назад
1 год назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Commands;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use LaravelZero\Framework\Commands\Command;
  5. use Illuminate\Support\Facades\Process;
  6. class Detalle_wifi extends Command
  7. {
  8. /**
  9. * The signature of the command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'detalle_wifi';
  14. /**
  15. * The description of the command.
  16. *
  17. * @var string
  18. */
  19. protected $description = 'Este comando te dara una descripcion detallada de la red';
  20. /**
  21. * Execute the console command.
  22. *
  23. * @return mixed
  24. */
  25. //lo que debo obtener con la red del parceo es lo siguiente:
  26. //1-. nombre de la red
  27. //2-. tipo de encriptacion
  28. //3-. canal en el que esta
  29. //4-. Frecuencia
  30. public function handle()
  31. {
  32. /*$result = Process::run('netsh wlan show networks mode=Bssid');
  33. $salidascanwifi = $result->output();*/
  34. $salidascanwifi = file_get_contents('scanwifi.txt');
  35. //preg_match_all("/SSID \d+ :/", $salidascanwifi, $parsescanwifi);
  36. $parsescanwifi = explode('BSSID ', $salidascanwifi);
  37. dd($parsescanwifi);
  38. //Primero hay que separar por cada uno de los ssid
  39. //Luego hay que sacar la informacion de cada uno de los BSSID
  40. $parsescanwifi = end($parsescanwifi);
  41. $parsescanwifi = explode("\n", trim($parsescanwifi, "\n\r"));
  42. $scanwifi = [];
  43. return $scanwifi;
  44. }
  45. /**
  46. * Define the command's schedule.
  47. *
  48. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  49. * @return void
  50. */
  51. public function schedule(Schedule $schedule): void
  52. {
  53. // $schedule->command(static::class)->everyMinute();
  54. }
  55. }