Giter VIP home page Giter VIP logo

resin-network-config's Introduction

resin-network-config

npm version dependencies Build Status Build status

DEPRECATED in favor of https://github.com/resin-io/resin-device-config

Handle resin images network configuration.

Installation

Install resin-network-config by running:

$ npm install --save resin-network-config

Documentation

Object network.getFiles(Object options = {})

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
	'''
}

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.

resin-network-config's People

Contributors

jviotti avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.