-
Notifications
You must be signed in to change notification settings - Fork 75
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
Last Login....: None #8
Comments
I fixed this here: https://gist.github.com/vidia/5d760a27cec2b9bd318dcc5c636c5a1d#file-motd-sh-L113 and line 123 as well. |
Still not working for me, replaced both lines 113 and 123 |
I'm getting the same issue. I've replicated the highlighted line and it doesn't show a usage error, but it's still printing None under login. I'm guessing there's a problem either with the If statement or the value $loginDate. |
I was having the same issue. I applied the fixes from @vidia, but it still didn't work until I made one more change. On line 122 from @vidia's link above the IF statement is looking for a "T" in the $loginDate string and on my Raspberry Pi that doesn't exist, so I changed the if [[ $loginDate == T ]]; to if [[ $loginDate != T ]];. Now it works. |
Don't use my fix listed above, It has issues on some days of the week. There may be better ways to fix it, but for now I just changed it to $loginDate == * instead of $loginDate == *T*. This is more of a hack, but I think it will be okay for now. if [[ $loginDate == * ]]; then |
signed up for github just to leave this fix! hope that it works for all... i dont know if i am supposed to modify the code with this slightly hackish fix or just leave it, but at least i'll leave a comment with how i fixed it... the issue for this is that the "--time-format" switch is not supported on this version of the date command for whatever reason. the work around i cobbled together involves line 100: original code: modified (and added line) code: the key difference is that it changes the date to display the full date with the -F switch, and pulls all of the individual date elements followed up by the next command to join all of the different strings into the ISO formatted string that the later code (if [[ $loginDate == T ]]; then...), that particular if is looking for the "T" that is present in an iso formatted timestamp which was originally designed to come from the "--time-format iso" portion. |
I tried that fix but couldn't get it to work for some reason. With your modified code it displays the login IP but no data to the left of that. |
what is the output of
---EDIT--- |
Yep that fixed it! Awesome thanks. |
The 'last login' line doesn't work for me. I'm on a Pi Zero with:
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
I also got the 'last: invalid option -- '-'' problem (see other issue) but PenguinPaws's comment fixed that!
The text was updated successfully, but these errors were encountered: