Closed sky1es closed 1 year ago
It is working exactly as intended. It shows the last login not current login. Last login log is updated after motd is displayed. If you execute the cmd after login with NR=1, it will show you the current login.
If you delete all your last login log history. It shows you "None", just like the first ever login.
If you are still not seeing the correct behavior, may be something different/wrong with your setup/OS. BTW, welcome to github.
You are right :-) Thanks for the explanation. I ran the code after login, and so got the current login. It makes sense. Sorry to bother you with this.
"Last" is showing current login date/time. To get last login change "NR==1" to "NR==2" in "/update-motd.d/15-system".