Push dev work to master #2
|
@ -23,19 +23,19 @@ function parseConfig (str) {
|
|||
const lines = str.split('\n')
|
||||
let network = {}
|
||||
for (let line of lines) {
|
||||
if (line.indexOf('network={') !== -1) {
|
||||
if (line.substring(0, 9) === 'network={') {
|
||||
network = {}
|
||||
network.raw = line
|
||||
} else if (line.indexOf('ssid=') !== -1) {
|
||||
} else if (network.raw && line.indexOf('ssid=') !== -1) {
|
||||
network.ssid = line.replace('ssid=', '').trim().replace(quoteRe, '')
|
||||
if (network.raw) {
|
||||
network.raw += '\n' + line
|
||||
}
|
||||
} else if (line.indexOf('}') !== -1) {
|
||||
} else if (network.raw && line.substring(0, 1) === '}') {
|
||||
network.raw += '\n' + line
|
||||
networks.push(network)
|
||||
network = {}
|
||||
} else if (network.ssid) {
|
||||
} else if (network.raw) {
|
||||
network.raw += '\n' + line
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue