changed how hostname is determined

This commit is contained in:
Bruno Miguel Silva
2014-01-09 16:15:13 +00:00
parent cce1db8d9c
commit 813cbeb31c
+10 -7
View File
@@ -1,8 +1,3 @@
#function parse_git_branch {
# git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
#}
#export PS1='\u@\h:\W $(parse_git_branch)\n\$ '
export EDITOR='vi'
export WORKON_HOME=$HOME/.virtualenvs
export LC_CTYPE="en_US.UTF-8"
@@ -18,8 +13,16 @@ alias gitpretty="git log --pretty=format:'%h : %Cblue%aN%Creset : %Cred%d%Creset
alias ls='ls -G'
alias ll='ls -lG'
if [[ -r $HOME/.`hostname -s`_bash_profile ]]; then
source $HOME/.`hostname -s`_bash_profile
if [[ -r $HOME/.host_nickname ]]; then
HOST_NICKNAME=`cat .host_nickname`
else
HOST_NICKNAME=`hostname -s`
fi
export PS1="\u@${HOST_NICKNAME}:\W \$ "
if [[ -r $HOME/.${HOST_NICKNAME}_bash_profile ]]; then
source $HOME/.${HOST_NICKNAME}_bash_profile
else
echo "WARNING: Can't find custom bash_profile"
fi