update mymotd

This commit is contained in:
Ruben Blanco 2023-11-06 10:38:09 +01:00
parent e8b0270a88
commit a6360f5ed9
1 changed files with 6 additions and 3 deletions

View File

@ -3,9 +3,12 @@ GREEN="\033[0;32m"
WHITE="\033[0;37m" WHITE="\033[0;37m"
RED='\033[0;31m' RED='\033[0;31m'
RESET="\033[0m" RESET="\033[0m"
LAST_LOGIN_USER=$(lastlog | tail -n 1 | awk '{print $1}') #LAST_LOGIN_USER=$(lastlog | tail -n 1 | awk '{print $1}')
LAST_LOGIN_TIME_HOUR=$(lastlog | tail -n 1 | awk '{print $4" "$5" "$6" "$7}') LAST_LOGIN_USER=$(last |head -n +2 | tail -n 1 | awk '{ print $1 }')
LAST_LOGIN_IP_FROM_USER=$(lastlog | tail -n 1 | awk '{print $3}') #LAST_LOGIN_TIME_HOUR=$(lastlog | tail -n 1 | awk '{print $4" "$5" "$6" "$7}')
LAST_LOGIN_TIME_HOUR=$(last |head -n +2 | tail -n 1 | awk '{ print $4" "$5" "$6" "$7 }')
#LAST_LOGIN_IP_FROM_USER=$(lastlog | tail -n 1 | awk '{print $3}')
LAST_LOGIN_IP_FROM_USER=$(last |head -n +2 | tail -n 1 | awk '{ print $3 }')
UPTIME_SYSTEM=$(uptime -p | tr -d ',') UPTIME_SYSTEM=$(uptime -p | tr -d ',')
NUMBER_USERS_CONNECTED=$(uptime | awk '{print $5" "$6}' | tr -d ",") NUMBER_USERS_CONNECTED=$(uptime | awk '{print $5" "$6}' | tr -d ",")
LIST_USERS_CONNECTED=$(w | tail -n +2) LIST_USERS_CONNECTED=$(w | tail -n +2)