Put startup tasks in a usermotd () function

This commit is contained in:
Anthony Rose 2021-11-01 10:45:28 +00:00
parent 8d549fa1c4
commit 00ec029348

View file

@ -190,19 +190,6 @@ then
alias dnf=yum alias dnf=yum
fi fi
case "$-" in
*i*)
# Shell is interactive
printf "\033[7m"; uname -sr; printf "\033[0m"
if [ -r /etc/os-release ]
then
echo " $(. /etc/os-release; echo $NAME $VERSION)"
fi
;;
*)
;;
esac
if [ -S "$SSH_AUTH_SOCK" ] \ if [ -S "$SSH_AUTH_SOCK" ] \
&& [ -r "$HOME/.ssh/id_ed25519" ] \ && [ -r "$HOME/.ssh/id_ed25519" ] \
&& [ -r "$HOME/.ssh/id_ed25519.pub" ] \ && [ -r "$HOME/.ssh/id_ed25519.pub" ] \
@ -216,9 +203,23 @@ then
. "$HOME/.bashrc.local" . "$HOME/.bashrc.local"
fi fi
usermotd () {
printf "\033[7m"; uname -sr; printf "\033[0m"
if [ -r /etc/os-release ]
then
echo " $(. /etc/os-release; echo $NAME $VERSION)"
fi
uptime
if ! [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/locale.conf" ]; then
echo "${XDG_CONFIG_HOME:-$HOME/.config}/locale.conf does not exist"
fi
echo "LANG=$LANG"
}
case "$-" in case "$-" in
*i*) *i*)
echo "LANG=$LANG" # Shell is interactive
usermotd
;; ;;
*) *)
;; ;;