aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-01-15 02:15:20 -0500
committertdro <tdro@users.noreply.github.com>2020-01-15 02:15:20 -0500
commit7251092700711865ba956802e1c2b8ae93428673 (patch)
tree2fd5adaecf239efda604e6fac0a68bbaec3ba0ed /.bashrc
parent5f1f949377c394d8577e21e23f036d854f826a79 (diff)
downloaddotfiles-7251092700711865ba956802e1c2b8ae93428673.tar.gz
dotfiles-7251092700711865ba956802e1c2b8ae93428673.tar.bz2
dotfiles-7251092700711865ba956802e1c2b8ae93428673.zip
.bashrc: Check for root prompt on SSH
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc11
1 files changed, 6 insertions, 5 deletions
diff --git a/.bashrc b/.bashrc
index 3f7a557..13f3e95 100644
--- a/.bashrc
+++ b/.bashrc
@@ -7,6 +7,12 @@
[[ "$EUID" -ne 0 ]] && PS1='\[\e[0;34m\]\W \$\[\e[0m\] '
[[ "$EUID" -eq 0 ]] && PS1='\[\e[1;31m\]\W \$\[\e[0m\] '
+# ssh bash prompt color change
+if [ -n "$SSH_CLIENT" ]; then
+ [[ "$EUID" -ne 0 ]] && export PS1='\[\e[1;32m\]\W \$\[\e[0m\] ';
+ [[ "$EUID" -eq 0 ]] && export PS1='\[\e[1;31m\]\W \$\[\e[0m\] '
+fi
+
# cd using directory name
shopt -s autocd;
@@ -55,11 +61,6 @@ man() {
man "$@"
}
-# ssh bash prompt color change
-if [ -n "$SSH_CLIENT" ]; then
- export PS1='\[\e[1;32m\]\W \$\[\e[0m\] '
-fi
-
# disable less history
export LESSHISTFILE=-