node-network-interfaces
This is a node Wrapper around Network-Interface-Script written by Joe Kuan.
Allows you to read and update the contents of your /etc/network/interfaces
file.
Concerns
This library is obviously only usable on systems that manage their network stack using /etc/network/interfaces
although you can
point the library at any file that has the same format.
More importantly - it depends on passwordless sudo for write access to the /etc/network/interfaces
file. You will have to do the necessary work to enable this in your environment.
Finally, it depends on access to the tee
command.
Usage
const NetworkInterfaces = ; const interfaces = '/absolute/path/to/my/interfaces/file'; // Read the config for a given interface interfaces; // Write to the config for a given interface interfaces
For usage sample and more information, see this blog. For updating DNS entry, see this blog.