Add support for non-interactive mode
authorMykola Malkov <mmalkov@sipwise.com>
Mon, 30 Jul 2018 11:27:38 +0000 (14:27 +0300)
committerMykola Malkov <mmalkov@sipwise.com>
Mon, 30 Jul 2018 11:27:38 +0000 (14:27 +0300)
commiteebbac24ec6479c6c88593892f7d1616b91ccc19
treeb9e8ebd9c31ba6ab893c83fcf2d55d086f637287
parent45b8379191095cf50ac2e58569e1820957a2cae5
Add support for non-interactive mode

Network device and parameters can be passed via environment variables
so script will create the network configuration without asking for
parameters.
Limitations - wlan and vlan configurations are not supported.

The list of parameters:
NET_DEV - name of network interface to configure.
METHOD - method of obtaining IP address. Can be dhcp|static|manual.
If both of these parameter defined then non-interactive mode is
used.

IPADDR - IP address for network interface.
NETMASK - netmask for network interface.
If method is 'static' or 'manual' then these parameters are mandatory.

GATEWAY - address of default route.
DNS - comma separated list of dns servers.

Add '--force' key to ifdown command before configuration of the interface.
It is required for interface reconfiguration.
sbin/netcardconfig