motd.sh: fix last login display
This commit is contained in:
parent
065455440d
commit
f7e44cc48b
2
motd.sh
2
motd.sh
@ -105,7 +105,7 @@ done <<< $(echo -e "$DISKS")
|
|||||||
|
|
||||||
|
|
||||||
### Welcome message ###
|
### Welcome message ###
|
||||||
LAST_LOGIN=$(last -w | grep arisu | head -2 | tail -1)
|
LAST_LOGIN=$(last -w --time-format iso | grep $(whoami) | head -2 | tail -1)
|
||||||
echo -e
|
echo -e
|
||||||
echo -e "Welcome to $(hostname), $(whoami)!
|
echo -e "Welcome to $(hostname), $(whoami)!
|
||||||
Last login: $(echo "$LAST_LOGIN" | awk '{for(i=4;i<=NF;i++) print $i}' | paste -sd ' ') from $(echo "$LAST_LOGIN" | awk '{print $3}')"
|
Last login: $(echo "$LAST_LOGIN" | awk '{for(i=4;i<=NF;i++) print $i}' | paste -sd ' ') from $(echo "$LAST_LOGIN" | awk '{print $3}')"
|
||||||
|
Loading…
Reference in New Issue
Block a user