{bash,zsh}rc: handle Kali not having last out of the box

This commit is contained in:
Aminda Suomalainen 2024-07-24 19:51:48 +03:00
parent 9473b1f988
commit bcce27ac4a
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 11 additions and 2 deletions

View File

@ -144,7 +144,12 @@ if hash lsb_release 2> /dev/null; then
printf "\n"
printf "$(uptime --pretty)\t$(uptime)\n"
printf "\nPresent:\n"
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
if hash who 2> /dev/null; then
who --heading --lookup --mesg --users
elif hash last 2> /dev/null; then
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
fi
printf "\n"
df / $HOME --human-readable --output=source,fstype,size,used,avail,pcent | uniq
)

View File

@ -37,7 +37,11 @@ if hash lsb_release 2> /dev/null; then
printf "\n"
printf "$(uptime --pretty)\t$(uptime)\n"
printf "\nPresent:\n"
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
if hash who 2> /dev/null; then
who --heading --lookup --mesg --users
elif hash last 2> /dev/null; then
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
fi
printf "\n"
df / $HOME --human-readable --output=source,fstype,size,used,avail,pcent | uniq
)