Add comments to MOTD function
This commit is contained in:
parent
2c42757078
commit
42b33bf233
1 changed files with 15 additions and 1 deletions
|
@ -327,7 +327,11 @@ usermotd () {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
export _acp_motd_shown=1
|
export _acp_motd_shown=1
|
||||||
|
|
||||||
|
# OS (kernel) name and version in reverse video.
|
||||||
printf "\033[7m"; uname -sr; printf "\033[0m"
|
printf "\033[7m"; uname -sr; printf "\033[0m"
|
||||||
|
|
||||||
|
# Distro name and version on Linux and macOS.
|
||||||
if [ -r /etc/os-release ]
|
if [ -r /etc/os-release ]
|
||||||
then
|
then
|
||||||
echo " $(. /etc/os-release; echo "$NAME" "$VERSION")"
|
echo " $(. /etc/os-release; echo "$NAME" "$VERSION")"
|
||||||
|
@ -336,21 +340,31 @@ usermotd () {
|
||||||
then
|
then
|
||||||
echo " $(sw_vers -productName) $(sw_vers -productVersion)"
|
echo " $(sw_vers -productName) $(sw_vers -productVersion)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# System uptime and load averages.
|
||||||
uptime
|
uptime
|
||||||
|
|
||||||
|
# Language for the shell.
|
||||||
echo "LANG=$LANG"
|
echo "LANG=$LANG"
|
||||||
|
|
||||||
|
# Timezone.
|
||||||
if [ -n "$TZ" ]
|
if [ -n "$TZ" ]
|
||||||
then
|
then
|
||||||
echo "TZ=$TZ"
|
echo "TZ=$TZ"
|
||||||
elif [ -x /usr/bin/timedatectl ] && [ "x$(systemctl is-system-running)" != "xoffline" ]
|
elif [ -x /usr/bin/timedatectl ] && [ "$(systemctl is-system-running)" != offline ]
|
||||||
then
|
then
|
||||||
timedatectl show --property=Timezone | sed 's/Timezone=/TZ=/'
|
timedatectl show --property=Timezone | sed 's/Timezone=/TZ=/'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Shell name and version.
|
||||||
if [ -n "$BASH_VERSION" ]
|
if [ -n "$BASH_VERSION" ]
|
||||||
then
|
then
|
||||||
echo "bash $BASH_VERSION"
|
echo "bash $BASH_VERSION"
|
||||||
elif [ -n "$ZSH_VERSION" ]
|
elif [ -n "$ZSH_VERSION" ]
|
||||||
then
|
then
|
||||||
echo "zsh $ZSH_VERSION"
|
echo "zsh $ZSH_VERSION"
|
||||||
|
else
|
||||||
|
echo "shell unknown"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue