From f7e44cc48ba1cb5bfb2ba14d97fe6e9340d86c70 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 29 Aug 2021 16:25:08 +0200 Subject: [PATCH] motd.sh: fix last login display --- motd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/motd.sh b/motd.sh index 3ffc89c..c66220c 100755 --- a/motd.sh +++ b/motd.sh @@ -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}')" @@ -121,4 +121,4 @@ if test $(command -v zfs); then echo -e "${red}Warning! ${white}$name ${undim}has less than 150GB" fi done <<< $(echo -e "$POOLS") -fi \ No newline at end of file +fi