add .bashrc.local for servers (prompt with highlighting)

This commit is contained in:
Lexi / Zoe 2019-12-12 03:18:36 +01:00
parent 3304185782
commit 5059cf0ba4
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#
# ~/.bashrc.local -- SERVER version
#
# Assume colors are set in global .bashrc:
# - TRED
# - TGREEN
# - TBLUE
# - TGREENB
# - TCYANB
# - TWHITEB (bold)
# - TRESET
# Set prompt: highlight hostname in red to signalize "you're on a server, be careful"
if [[ ${EUID} == 0 ]] ; then
PS1="${TRED}\u@\h ${TBLUE}\w ${TWHITEB}\$ ${TRESET}"
else
PS1="${TGREEN}\u@${TRED}\h ${TBLUE}\w ${TWHITEB}\$ ${TRESET}"
fi