X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=roles%2Fcommon%2Ffiles%2Fbash_prompt.sh;h=d77e4a098135abd528c10d6f27cbf9c8b9562be7;hb=588872ef49cb75a5ffa775e738ae3c61f9d7bad0;hp=a0a3d8c3995d31cc5ccb78af1f8e581c42400a82;hpb=164fb4ac7aebf84ca89433aeee8d16771fb8b7da;p=awsible diff --git a/roles/common/files/bash_prompt.sh b/roles/common/files/bash_prompt.sh index a0a3d8c..d77e4a0 100644 --- 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 _user="${_cyan}\u${_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 _app="${_yellow}${CLOUD_APP}-${CLOUD_DEV_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