Replace _local/_server/.bashrc.local with .bashrc.d/60_server.sh

This commit is contained in:
Lexi / Zoe 2021-05-29 14:21:54 +02:00
parent e070f0aebc
commit 45e94dc53b
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
3 changed files with 18 additions and 46 deletions

18
.bashrc.d/60_server.sh Normal file
View File

@ -0,0 +1,18 @@
#
# ~/.bashrc.d/60_server.sh -- Custom .bashrc additions for server environments
#
# Set this alias only on hosts where restic is installed
if which restic &>/dev/null; then
alias restic-source-env="source /etc/restic/restic.env"
fi
# 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

View File

@ -1,23 +0,0 @@
#
# ~/.bashrc.local -- SERVER version
#
alias restic-source-env="source /etc/restic/restic.env"
# 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

View File

@ -1,23 +0,0 @@
#
# ~/.bashrc.local -- toriel version
#
#alias restic-source-env="source /etc/restic/restic.env"
# 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