Restore wifi functionality for writing full config file.

This commit is contained in:
mmcwilliams 2018-01-01 00:28:11 -05:00
parent 5496881616
commit 4ce4ac2735
1 changed files with 1 additions and 6 deletions

View File

@ -88,22 +88,17 @@ class Wifi {
console.error(err)
return _cb(err)
}
console.log(data)
parsed = parseConfig(data)
console.dir(parsed)
current = parsed.find(network => {
return network.ssid === _ssid
})
console.log(current)
if (typeof current !== 'undefined') {
data = data.replace(current.raw, _entry)
} else {
data += '\n\n' + _entry
}
console.log(data)
_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,