Restore wifi functionality for writing full config file.
This commit is contained in:
parent
5496881616
commit
4ce4ac2735
|
@ -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