From e0f6c97e02eb74dda25304ce53f604f686f0c2a5 Mon Sep 17 00:00:00 2001 From: Armando Ceballos Date: Wed, 24 May 2023 19:49:24 -0600 Subject: [PATCH] Corregir para implementar el regex --- app/Commands/Redes_wifi.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Commands/Redes_wifi.php b/app/Commands/Redes_wifi.php index ee97a76..1fd7a77 100644 --- a/app/Commands/Redes_wifi.php +++ b/app/Commands/Redes_wifi.php @@ -29,6 +29,7 @@ class Redes_wifi extends Command */ public function handle() { + $this->getProfilesRegex(); $essid = $this->argument('essid'); $profiles = $this->getProfiles(); if (isset($essid) && (!$this->option('list'))) { @@ -37,12 +38,18 @@ class Redes_wifi extends Command } foreach ($profiles as $profile) { $linea = "[{$profile}] "; - if (!$this->option('list')) + if (!$this->option('list')) $linea .= $this->getPassword($profile); $this->line($linea); } } + public function getProfilesRegex() + { + $parse = file_get_contents('profiles.txt'); + preg_match("/: \s*(.*)/", $parse, $profiles); + dd($profiles); + } public function getProfiles() { $result = Process::run('netsh wlan show profile');