ar51an / raspberrypi-motd

Dynamic Message Of The Day (MOTD) For Raspberry Pi
MIT License
62 stars 14 forks source link

Use bkt to cache the output of apt-get update and apt-get -s dist-upgrade #10

Open shurane opened 4 months ago

shurane commented 4 months ago

I was thinking of a way to simplify the update-motd-static.d directory, and I think this is a good way to approach it. It requires use of https://github.com/dimo414/bkt, but it simplifies needing to generate a new motd script file. bkt can cache the output of a command for a duration with --ttl, and you can also force update the cache with --force. This way, it should never hang when the user is logging in to see the updates available on the raspberry pi (or other device).

I also saw an opportunity to simplify the bash script a bit,