diff options
author | Jakub Jankowski <shasta@toxcorp.com> | 2017-11-21 02:38:53 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2017-11-21 00:07:59 -0600 |
commit | 9a51af88aa234e2ceb6a1daf830f63a11202beb3 (patch) | |
tree | c6efa8ebdcfc82c4ddebe28cb2445ed69763c7ca /rc.inet1.conf | |
parent | 230e46830f5d6915c8203c6e75497973ac48bc8c (diff) | |
download | slacknetsetup-9a51af88aa234e2ceb6a1daf830f63a11202beb3.tar.xz |
rc.inet1*: Simplify virtif_* code, add note to example config
There is a built-in way of counting the number of elements in an array:
${#arrayname[@]}. Use this, and the fact that "for i in $(seq 0 -1)" will
not evaluate body of the loop even once, to simplify code and get rid of
virtif_determine().
While at it, add a note to rc.inet1.conf mentioning the necessity of
keeping array indexes monotonically increasing (from 0), otherwise the
code will fail (so would the original code).
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1.conf')
-rw-r--r-- | rc.inet1.conf | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rc.inet1.conf b/rc.inet1.conf index 11e68ab..58766d2 100644 --- a/rc.inet1.conf +++ b/rc.inet1.conf @@ -63,7 +63,9 @@ DEBUG_ETH_UP="no" # Virtual interfaces to create - these are created before any address # configuration or bridge setup is done, so you may use these interfaces # as IFNAME or BRNICS values. These can be tun or tap interfaces: -# adjust VIRTIFNAME and VIRTIFTYPE accordingly +# adjust VIRTIFNAME and VIRTIFTYPE accordingly. +# Starting with VIRTIFNAME[0] is mandatory, and each next one must be +# incremented by one, so VIRTIFNAME[1], VIRTIFNAME[2], and so on. # # Virtual tap interface example #VIRTIFNAME[0]="tap0" |