Closed brthld closed 4 years ago
Thanks for that! I will take a look whats wrong there. But I guess it needs some days.
So if you remove the --swap
command everything works until then, right?
zsh
stops the execution with the error message, bash
continues the execution and prints Services, Updates and Logins just nicely after the displayed error.
--swap
is displayed correctly in every case, the problem is contained in --diskspace
and if i remove this module, then everything is ok in both bash
and zsh
, generally i prefer zsh
Ok, i will check it with zsh
and try to find out whats wrong.
Unfortunately, I cant reproduce it.
I found some other problems on zsh
. But nothing in the diskspace module.
You could run
set -x
source .bashrc_motd
bash_motd --diskspace
and look into it, or post the output here.
I found it. We have to exclude the swap from the disks in diskusage. Can you replace line 317 with:
lsblk -Jlo NAME,MOUNTPOINT | jq -c '.blockdevices | sort_by(.mountpoint) | .[] | select( .mountpoint != null and .mountpoint != "[SWAP]" )'
And test it?
Edit: the fix is now in the latest version: https://github.com/x70b1/motd-on-acid/commit/0435c9bfedc5e121415f0f5308a2845e893568ef
Confirmed! Now my bash_motd --banner --processor --memory --swap --diskspace --services --updates
works flawlessly in zsh
and bash
- I appreciate your work :) !
Hi, thank you for the good and beautiful work so far.
While setting it up on my server, i experienced an issue. Everything worked good out of the box, except on line in the "Diskspace:" area. After displaying correctly my hard drives, i get this on
zsh
:generate_bar_disk:11: bad math expression: operand expected at end of string
after switching to
bash
, it seems to be an issue where the SWAP-Partition is counted as seperate disk:bash: [: Used: integer expression expected
[SWAP] UsedM used / 1M available