DEPRECATED in favor of https://github.com/resin-io/resin-device-config
Handle resin images network configuration.
Install resin-network-config
by running:
$ npm install --save resin-network-config
Get network related configuration files.
The function accepts an optional options
object which can have the following properties:
options.wifiSsid
, a string that represents the wifi ssid to connect to. If this property is not defined, only ethernet connection will be configured for the device.options.wifiKey
, a string that represents the wifi key to use with the defined wifi ssid. If this property is not defined, then the wifi connection will be configured without a passphrase.
networkConfig = require('resin-network-config')
files = networkConfig.getFiles
wifiSsid: 'foobar'
wifiKey: 'hello'
console.log(files)
{
'network/settings': '''
[global]
OfflineMode=false
[WiFi]
Enable=true
Tethering=false
[Wired]
Enable=true
Tethering=false
[Bluetooth]
Enable=true
Tethering=false
''',
'network/network.config': '''
[service_home_ethernet]
Type = ethernet
Nameservers = 8.8.8.8,8.8.4.4
[service_home_wifi]
Type = wifi
Name = foobar
Passphrase = hello
Nameservers = 8.8.8.8,8.8.4.4
'''
}
Run the test suite by doing:
$ gulp test
- Issue Tracker: github.com/resin-io/resin-network-config/issues
- Source Code: github.com/resin-io/resin-network-config
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
If you're having any problem, please raise an issue on GitHub.
The project is licensed under the MIT license.