Browse Source

Ya funciona con expresion regular

master
parent
commit
0d5da3729c
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      app/Commands/Redes_wifi.php

+ 8
- 5
app/Commands/Redes_wifi.php View File

@@ -29,9 +29,10 @@ class Redes_wifi extends Command
*/
public function handle()
{
//$this->getProfilesRegex();
$essid = $this->argument('essid');
$profiles = $this->getProfiles();
//$profiles = $this->getProfiles();
$profiles = $this->getProfilesRegex();
if (isset($essid) && (!$this->option('list'))) {
$this->line("[{$essid}] ".$this->getPassword($essid));
return 0;
@@ -46,9 +47,11 @@ class Redes_wifi extends Command

public function getProfilesRegex()
{
$parse = file_get_contents('profiles.txt');
preg_match("/: \s*(.*)/", $parse, $profiles);
dd($profiles);
$result = Process::run('netsh wlan show profile');
$salidaprofiles = $result->output();
//$salidaprofiles = file_get_contents('profiles.txt');
preg_match_all("/: \s*(.*)/", $salidaprofiles, $profiles);
return $profiles[1];
}
public function getProfiles()
{


Loading…
Cancel
Save