Skip to content

Commit

Permalink
MOTD: display hostapd parameters if AP is in operation
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Oct 8, 2024
1 parent 9697c17 commit d0aec22
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/bsp/common/etc/update-motd.d/10-armbian-header
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 ""

0 comments on commit d0aec22

Please sign in to comment.