diff options
author | Jessica Clarke <jrtc27@FreeBSD.org> | 2024-02-03 01:52:37 +0000 |
---|---|---|
committer | Jessica Clarke <jrtc27@FreeBSD.org> | 2024-02-03 01:52:37 +0000 |
commit | b809c7d6a26924ac351e49a15011da718cc3feec (patch) | |
tree | 41ad3da23bab1a24768180e34ce8e4457485c74c /usr.sbin | |
parent | fb3dc55a5c22a619686ce667bcbe8a4c84a3ce34 (diff) | |
download | src-b809c7d6a26924ac351e49a15011da718cc3feec.tar.gz src-b809c7d6a26924ac351e49a15011da718cc3feec.zip |
bsdinstall: Fix netconfig script when no interfaces are present
The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
is empty and will exit early if so, but INTERFACES always contains at
least a space due to the way it appends the list of wireless devices.
Fix this by only adding the space when there are devices to append,
mirroring the behaviour for non-wireless devices above (both will result
in a redundant leading space when the list is non-empty, but that one is
harmless).
Fixes: 159ca5c844cd ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rwxr-xr-x | usr.sbin/bsdinstall/scripts/netconfig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index addf5cb527d6..a370d455e211 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -49,7 +49,8 @@ for IF in `ifconfig -l`; do INTERFACES="$INTERFACES $IF" done -INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)" +WIRELESS_INTERFACES="$(sysctl -in net.wlan.devices)" +INTERFACES="$INTERFACES${WIRELESS_INTERFACES:+ }$WIRELESS_INTERFACES" is_wireless_if() { for IF in $(sysctl -in net.wlan.devices); do if [ $IF = $1 ]; then |