The banner is very useful to see what IP addresses has been assigned. But then I noticed the wlan0 IP address is shown and another time the eth0 IP address, randomly.
Using dietpi-banner tool I have solved this by defining my own LAN IP item, using the Custom Entry (option 10).
First I disabled the original “LAN IP” (option 5) and enabled option 10.
Then I choose OK and put in this custom entry command: echo -e "ETH: $(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') | WLAN: $(ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
and named it also: LAN IP
This solved my problem. Maybe useful for others and/or a future version of Dietpi
EDIT: I had to enable option 5 again as my Custom Entry is only shown when I SSH login. The banner that is shown on-screen right after booting up only shows option 5 (with the random IP). So the request stays “would like to see both”. Thanks.
Don’t understand this, option 10 is for weather , option 5 is only LAN IP.
Or did you mean option 5 of dietpi-banner (which would be for cloudshell??) and option 10 of dietpi-config -> autostart?
What about option 17 in the autostart options (Custom script executed in foreground and auto-login)
My ethernet cable is plugged in and working. I frequently reboot my device and saw the wifi IP instead of the ethernet IP. That’s why I started looking for a fix. I want to see both IPs.
I did not expect that my Custom Entry is not shown on-screen after booting (only after SSH login), so the missing “LAN IP” message now became a problem not knowing the address. So I flipped option 5 back on.
Note: My Custom Entry is rather useless when I already managed to SSH into my device
You say “the Banner should prefer ethernet over wifi” (which makes sense too) but I have seen different. I shall do some repeated tests (reboots) later today to see if I can reproduce the issue and report back.
Ahh now I understood your request/question. The banner (before login) on the attached physical screen is not managed by dietpi-banner (as far as I know) Would need to check our code where this is coming from.
found it.
after boot, the banner on a physical screen is called from /boot/dietpi/postboot. There following is triggered /boot/dietpi/func/dietpi-banner 0 which displays top section + LAN IP.
Information for the used interface will be collected from global function
G_GET_NET -q iface
G_GET_NET -q ip
Means, no real way for an end-user to have it maintained
Yeah I found that code too, in /boot/dietpi/func/dietpi-banner, in function Print_Local_Ip. I was looking into that file first to fix it, but then I recalled the Custom Entry would be the clean way to solve it.
By the way:
I have rebooted my device several times now and it is truly so: sometimes wlan0 IP is shown and sometimes eth0 IP. It’s 50-50.
Since this script will be executed just before /boot/dietpi/func/dietpi-banner 0, the message showing both IP addresses shall appear first, right above the usual “LAN IP”.
I still use the Custom Entry as well. This in order to see both IP addresses in the banner when I SSH into my device. With this done it makes the option 5 “LAN IP” option superfluous for both cases and so I finally could disable option 5 in dietpi-banner.