Fix non-interactive interface choosing
authorMykola Malkov <mmalkov@sipwise.com>
Wed, 10 Oct 2018 12:53:51 +0000 (15:53 +0300)
committerMykola Malkov <mmalkov@sipwise.com>
Thu, 11 Oct 2018 15:29:22 +0000 (18:29 +0300)
commita186676d636aa5e5eed9ae554f0608082d560d38
treeae83b5e6f6b772e5faa02fb5c3c608f4abc389ea
parenteebbac24ec6479c6c88593892f7d1616b91ccc19
Fix non-interactive interface choosing

In interactive mode user choose an interface and its number is used
in the code. In function 'configiface' the actual interface is taken
from NETDEVICES by this number.

In non-interactive mode we have an interface name and it was used as
index in NETDEVICES which failed and the 1st interface was always taken.
It does not matter what interface was passed in NET_DEV variable script
tried to configure eth0.

Fix it with getting interface number by its name.
sbin/netcardconfig