projects
/
awsible
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
959f205
)
fix fancier prompt
author
Justin Wind
<j.wind@partner.samsung.com>
Thu, 9 Mar 2017 22:41:01 +0000
(14:41 -0800)
committer
Justin Wind
<j.wind@partner.samsung.com>
Thu, 9 Mar 2017 22:41:01 +0000
(14:41 -0800)
roles/common/files/bash_prompt.sh
patch
|
blob
|
history
diff --git
a/roles/common/files/bash_prompt.sh
b/roles/common/files/bash_prompt.sh
index a0a3d8c3995d31cc5ccb78af1f8e581c42400a82..ed8ffd3c20dcd56e0eeca4cba2d1aad817d8e592 100644
(file)
--- a/
roles/common/files/bash_prompt.sh
+++ b/
roles/common/files/bash_prompt.sh
@@
-6,12
+6,17
@@
prompt_string(){
local _cyan="\[\033[36m\]"
local _resultcode="${_yellow}\$?${_normal}"
local _cyan="\[\033[36m\]"
local _resultcode="${_yellow}\$?${_normal}"
+ local _user="${_cyan}\u${_normal}"
local _addr="${_green}${PUBLIC_IP}${_normal}"
local _addr="${_green}${PUBLIC_IP}${_normal}"
+ if [[ -z "${PUBLIC_IP}" ]]
+ then
+ _addr="${_green}${PRIVATE_IP}${_normal}"
+ fi
local _id="${_yellow}${INSTANCE_ID}${_normal}"
local _app="${_yellow}${CLOUD_MODULE}-${CLOUD_PHASE}${_normal}"
local _path="${_cyan}\w${_normal}"
local _id="${_yellow}${INSTANCE_ID}${_normal}"
local _app="${_yellow}${CLOUD_MODULE}-${CLOUD_PHASE}${_normal}"
local _path="${_cyan}\w${_normal}"
- echo ":${_resultcode}:${_
addr}:${_app}:${_id}:${_path}\n
\$ "
+ echo ":${_resultcode}:${_
user}@${_addr}:${_app}:${_id}:${_path}\n\
\$ "
}
export PS1=$(prompt_string)
unset -f prompt_string
}
export PS1=$(prompt_string)
unset -f prompt_string