MOTD: display hostapd parameters if AP is in operation
This commit is contained in:
parent
9697c17fbd
commit
c0a2278f8c
@ -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 ""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user