git: 5399052c63a7 - main - bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 19 Nov 2024 00:07:53 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=5399052c63a7a3d2f54615d31bfd092ab887a600

commit 5399052c63a7a3d2f54615d31bfd092ab887a600
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-11-09 01:10:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-11-19 00:06:16 +0000

    bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant
    
    Make sure an interface is back up before (re-)starting wpa_supplicant
    in wlanconfig not relying on wpa to UP the interface (though we fixed
    that).
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    emaste (in D47491)
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D47491
---
 usr.sbin/bsdinstall/scripts/wlanconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index f044bc1cba98..8ac64858eaba 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -55,7 +55,8 @@ country_set()
 		"$WLAN_IFACE" "$ifconfig_args"
 	error_str="${error_str#ifconfig: }"
 	# Restart wpa_supplicant(8) (should not fail).
-	[ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \
+	[ "$iface_up" ] && ifconfig "$WLAN_IFACE" up && \
+	    f_eval_catch -d wlanconfig wpa_supplicant \
 		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
 		"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
 	if [ "$error_str" ]; then