From acbcb0c505d9fa53985641c861d283b4751f0306 Mon Sep 17 00:00:00 2001 From: ricardopolo Date: Thu, 14 Nov 2019 10:49:39 -0500 Subject: [PATCH] code refactor --- lib/network.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/network.js b/lib/network.js index 400efdc..5c2d33d 100644 --- a/lib/network.js +++ b/lib/network.js @@ -324,6 +324,8 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) { state: 'Unknown', protocol: 'Unknown', }; + let i8021xState = ''; + let i8021xProtocol = ''; if(connectionType == 'wired' && ifaces.length > 0){ try { // Get 802.1x information by interface name @@ -355,14 +357,15 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) { console.log('Entro al catch del wired'); return i8021x; } - } else if (connectionType == 'wireless' && ifaces.length > 0){ + } else if (connectionType == 'wireless'){ try { - const SSID = getWindowsWirelessIfaceSSID(iface); + // const SSID = getWindowsWirelessIfaceSSID(iface); + const SSID = '1'; if(SSID !== 'Unknown') { console.log('ETAPA ERROR 1'); - let i8021xState = execSync(`netsh wlan show profiles "${SSID}" | findstr "802.1X"`, util.execOptsWin); + i8021xState = execSync(`netsh wlan show profiles "${SSID}" | findstr "802.1X"`, util.execOptsWin); console.log('ETAPA ERROR 2'); - let i8021xProtocol = execSync(`netsh wlan show profiles "${SSID}" | findstr "EAP"`, util.execOptsWin); + i8021xProtocol = execSync(`netsh wlan show profiles "${SSID}" | findstr "EAP"`, util.execOptsWin); console.log('ETAPA ERROR 3'); }