Browse Source

lxc container

master
pvincent 6 years ago
parent
commit
f2c10f1daf
  1. 18
      bash.bashrc

18
bash.bashrc

@ -58,9 +58,19 @@ __prompt_command() {
PS1=''
#check LXC container name and type
#PS1="${Red}PROD2 ${Yel}\u${R}"
if [[ $container == 'lxc' ]];then
PS1+="${Gra}[LXC:${R}"
local host=$container_hostname
case ${host:0:4} in
'beta')
PS1+="${Ora}";;
'prod')
PS1+="${Red}";;
*)
esac
PS1+="${host}${Gra}] "
fi
if [ `id -u` -eq 0 ]; then
PS1+="${Red}\u${R}"
PROMPT='$'
@ -84,7 +94,7 @@ __prompt_command() {
# current dir is version controlled
local branch=$(git branch 2> /dev/null | grep -e ^* | cut -d ' ' -f2)
PS1+=" ${R}[${Mag}${branch}${R}|"
local dirty=$(git status -s | wc -l)
if [[ $dirty -ne 0 ]]; then
PS1+="${Mag}…$dirty"

Loading…
Cancel
Save