Skip to content

SW_ShowNetAddr

Rolf Obrecht edited this page Aug 3, 2023 · 1 revision

Display network address in 1st console

Create file /lib/dhcpcd/dhcpcd-hooks/00-fix-ifwireless

case $interface in
        "wlan"*)
                if [ "$ifwireless" -ne "1" ]
                then
                        syslog err "env ifwireless not set to 1 on interface $interface, enforcing"
                        export ifwireless=1
                fi
                ;;
        *)
                echo "$interface not a wlan device"
                ;;
esac

create file /lib/dhcpcd/dhcpcd-hooks/99-myip

case "$reason" in
        BOUND|RENEW|REBIND|REBOOT|TIMEOUT)
                echo "\r\n\r\nMy IP Address is ${new_ip_address} (${interface})\r\n" > /dev/console
                ;;
        EXPIRE|FAIL|RELEASE|STOP)
                echo "\r\n\r\nDevice ${interface} disconnected\r\n" > /dev/console
                ;;
esac
Clone this wiki locally