33 lines
1.2 KiB
Bash
33 lines
1.2 KiB
Bash
# source prompt color: https://robotmoon.com/bash-prompt-generator/^
|
|
if [ $(whoami) == "gilles" ]; then
|
|
#export PS1="\[\033[0;32m\][\[\033[1;94m\]\u\[\033[0;33m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
|
|
export PS1="\[\e[38;5;216m\]\u\[\e[38;5;160m\]@\[\e[38;5;202m\]\h \[\e[38;5;131m\]\w \[\033[0m\]$ "
|
|
elif [ $(whoami) == "blutch" ]; then
|
|
export PS1="\[\033[0;32m\][\[\033[1;94m\]\u\[\033[0;33m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
|
|
elif [ $(whoami) == "root" ]; then
|
|
export PS1="\[\033[0;32m\][\[\033[0;31m\]\u\[\033[0;31m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
|
|
else
|
|
export PS1="[\u@\h \W]\$ "
|
|
fi
|
|
|
|
# Aliases
|
|
alias rm='rm -i'
|
|
alias cp='cp -i'
|
|
alias mv='mv -i'
|
|
alias ls='ls --color=auto'
|
|
alias sudo='sudo --preserve-env=PATH env' # https://www.petefreitag.com/blog/environment-variables-sudo/
|
|
|
|
if [[ "$USER" == "gilles" || "$USER" == "root" ]]; then
|
|
dist=$(cat /etc/redhat-release)
|
|
kern=$(uname -r)
|
|
cat << EOF
|
|
Distribution: $dist
|
|
Kernel: $kern
|
|
EOF
|
|
# execute only if user is gilles or root
|
|
#if [[ "$USER" == "gilles" || "$USER" == "root" ]]; then
|
|
# # display proxy status
|
|
# if [ -f "/usr/local/bin/proxyOnOff.sh" ]; then
|
|
# sudo /usr/local/bin/proxyOnOff.sh status
|
|
# fi
|
|
#fi |