Push dev work to master #2
|
@ -88,22 +88,17 @@ class Wifi {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
return _cb(err)
|
return _cb(err)
|
||||||
}
|
}
|
||||||
console.log(data)
|
|
||||||
parsed = parseConfig(data)
|
parsed = parseConfig(data)
|
||||||
console.dir(parsed)
|
|
||||||
current = parsed.find(network => {
|
current = parsed.find(network => {
|
||||||
return network.ssid === _ssid
|
return network.ssid === _ssid
|
||||||
})
|
})
|
||||||
console.log(current)
|
|
||||||
if (typeof current !== 'undefined') {
|
if (typeof current !== 'undefined') {
|
||||||
data = data.replace(current.raw, _entry)
|
data = data.replace(current.raw, _entry)
|
||||||
} else {
|
} else {
|
||||||
data += '\n\n' + _entry
|
data += '\n\n' + _entry
|
||||||
}
|
}
|
||||||
console.log(data)
|
|
||||||
_entry = null
|
_entry = null
|
||||||
setTimeout(this._writeConfigCb, 1)
|
fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
|
||||||
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* (internal function) Invoked after config file is written,
|
* (internal function) Invoked after config file is written,
|
||||||
|
|
Loading…
Reference in New Issue