Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: syntax error in /etc/update-motd.d/30-armbian-sysinfo #7234

Open
1 of 2 tasks
CT1IQI opened this issue Sep 14, 2024 · 3 comments
Open
1 of 2 tasks

[Bug]: syntax error in /etc/update-motd.d/30-armbian-sysinfo #7234

CT1IQI opened this issue Sep 14, 2024 · 3 comments
Labels
Bug Something isn't working as it should

Comments

@CT1IQI
Copy link

CT1IQI commented Sep 14, 2024

What happened?

30-armbian-sysinfo produces system info upon login, but the function display() can receiver as parameter $2 a floating point number from the traffic reporting function. Bash only knows integer arithmetic. In line
if [[ -n "$2" && "$2" -gt "0" && (( "${2%.}" -ge "$4" )) ]]; then
The '$2 -gt' throws an error. The second -ge has been corrected for not having the dot decimal part of the string.
This should also be done for the first:
if [[ -n "$2" && "${2%.
}" -gt "0" && (( "${2%.*}" -ge "$4" )) ]]; then

second problem:
hard coded in line 19 is the interface name eth0. But Armbian changed this to end0.

How to reproduce?

run the script

Branch

main (main development branch)

On which host OS are you running the build script and observing this problem?

Ubuntu 24.04 Noble

Are you building on Windows WSL2?

  • Yes, my Ubuntu/Debian/OtherOS is running on WSL2

Relevant log URL

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@CT1IQI CT1IQI added the Bug Something isn't working as it should label Sep 14, 2024
Copy link

Jira ticket: AR-2492

@igorpecovnik
Copy link
Member

hard coded in line 19 is the interface name eth0. But Armbian changed this to end0.

This is read from /etc/default/armbian-motd where we have:

PRIMARY_INTERFACE="$(ip route | grep '^default' | sed "s/.*dev //" | cut -d" " -f1 | head -1)"

Fixing is coming in a minute.

@SuperKali
Copy link
Sponsor Member

@CT1IQI should be fixed with #7247 can you retry with compile a newer version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as it should
Development

No branches or pull requests

3 participants