IS_AUTOIF: check only statically defined interfaces

This commit is contained in:
Jérémy Lecour 2022-08-29 17:01:48 +02:00 committed by Jérémy Lecour
parent a87438a41b
commit 1638ed1884
2 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Changed
* IS_AUTOIF: check only statically defined interfaces
### Deprecated
### Removed

View File

@ -575,8 +575,8 @@ check_autoif() {
interfaces=$(/sbin/ifconfig -s | tail -n +2 | grep -E -v "^(lo|vnet|docker|veth|tun|tap|macvtap|vrrp)" | cut -d " " -f 1 |tr "\n" " ")
fi
for interface in $interfaces; do
if ! grep -Rq "^auto $interface" /etc/network/interfaces*; then
failed "IS_AUTOIF" "Network interface \`${interface}' is not set to auto"
if grep -Rq "^iface $interface" /etc/network/interfaces* && ! grep -Rq "^auto $interface" /etc/network/interfaces*; then
failed "IS_AUTOIF" "Network interface \`${interface}' is statically defined but not set to auto"
test "${VERBOSE}" = 1 || break
fi
done