From 45e94dc53b2d0310020266bcff23cd3102c6346b Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sat, 29 May 2021 14:21:54 +0200 Subject: [PATCH] Replace _local/_server/.bashrc.local with .bashrc.d/60_server.sh --- .bashrc.d/60_server.sh | 18 ++++++++++++++++++ _local/_server/.bashrc.local | 23 ----------------------- _local/toriel/.bashrc.local | 23 ----------------------- 3 files changed, 18 insertions(+), 46 deletions(-) create mode 100644 .bashrc.d/60_server.sh delete mode 100644 _local/_server/.bashrc.local delete mode 100644 _local/toriel/.bashrc.local diff --git a/.bashrc.d/60_server.sh b/.bashrc.d/60_server.sh new file mode 100644 index 0000000..106b30f --- /dev/null +++ b/.bashrc.d/60_server.sh @@ -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 diff --git a/_local/_server/.bashrc.local b/_local/_server/.bashrc.local deleted file mode 100644 index 350cee1..0000000 --- a/_local/_server/.bashrc.local +++ /dev/null @@ -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 - diff --git a/_local/toriel/.bashrc.local b/_local/toriel/.bashrc.local deleted file mode 100644 index 22802e9..0000000 --- a/_local/toriel/.bashrc.local +++ /dev/null @@ -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 -