Is there any way to update the /etc/motd file on login? The /etc/profile and /etc/profile.d/*.sh scripts are executed after the motd is already displayed on login so these methods don't work.
I want to add dynamic details about the current IP address and display it in the motd. However, I can't find a way to update the motd before it gets displayed to the user logging in.
Thanks!
/etc/profileand the scripts in/etc/profile.d/. I can't reproduce what you are seeing in Alpine Linux. What I put in/etc/motdappears regardless of what is in those files.