motd.sh: fix last login display

This commit is contained in:
Alice Gaudon 2021-08-29 16:25:08 +02:00
parent 065455440d
commit f7e44cc48b

View File

@ -105,7 +105,7 @@ done <<< $(echo -e "$DISKS")
### 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 "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}')"