From c0a2278f8cff3f5d1c3df2596a6e318e3e270b00 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Tue, 8 Oct 2024 21:22:10 +0200 Subject: [PATCH] MOTD: display hostapd parameters if AP is in operation --- .../bsp/common/etc/update-motd.d/10-armbian-header | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/bsp/common/etc/update-motd.d/10-armbian-header b/packages/bsp/common/etc/update-motd.d/10-armbian-header index b4a35e590a..7b8ee7096b 100755 --- a/packages/bsp/common/etc/update-motd.d/10-armbian-header +++ b/packages/bsp/common/etc/update-motd.d/10-armbian-header @@ -85,6 +85,10 @@ KERNELID=$(uname -r) # Get other variables ip_address=$(get_ip_addresses &) wan_ip_address=$(get_wan_address &) +# Get access point info +if systemctl is-active --quiet service hostapd && [ -f /etc/hostapd/hostapd.conf ]; then +. /etc/hostapd/hostapd.conf +fi # Display software vendor logo echo -e "\e[1;91m$(figlet -f small " $VENDOR")\e[0m"; @@ -151,8 +155,15 @@ if [[ -n $HARDWARE_STATUS ]]; then fi IFS='|' read -r ipv4s ipv6s <<< "$ip_address" -echo -en " IP addresses: \x1B[93m(LAN)\x1B[0m IPv4: \x1B[92m${ipv4s// /, }\x1B[0m IPv6: \x1B[96m${ipv6s// /, }\x1B[0m" +echo -en " IP addresses: \x1B[93m(LAN)\x1B[0m IPv4: \x1B[92m${ipv4s// /, }\x1B[0m IPv6: \x1B[96m${ipv6s// /, }\x1B[0m " if [[ -n $wan_ip_address ]]; then echo -e "\x1B[93m(WAN)\x1B[0m $wan_ip_address" fi + +# Display hostapd +if [[ -n $ssid ]]; then + echo -e " WiFi AP: SSID: (\x1B[91m$ssid\x1B[0m), $(iw $interface info | grep channel | xargs)" +fi + + echo ""