diff options
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zshrc | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -29,6 +29,13 @@ zstyle '*' hosts # do not use /etc/hosts ZDIR=~/.zsh/ _HOST_TYPE=$(uname) +HOSTNAME=$(hostname -f 2>/dev/null) +if [[ $? == 0 ]]; then + echo "X" +else + HOSTNAME=$(hostname) +fi + # ############################################################################# # ssh-agent # ############################################################################# @@ -105,7 +112,7 @@ getcert () } on_gcloud () { - curl metadata.google.internal -i --connect-timeout 0.25 &>/dev/null + curl metadata.google.internal -i -m 1 &>/dev/null if [[ $? -eq 0 ]]; then echo "yes" else @@ -114,7 +121,7 @@ on_gcloud () { } on_aws () { - if [[ $(hostname -f | cut -d. -f 2) == "ec2" ]]; then + if [[ $(echo $HOSTNAME | cut -d. -f 2) == "ec2" ]]; then echo "yes" else echo "no" @@ -223,8 +230,8 @@ stty -ixon # enable mapping of C-s in vim.. autoload -U colors && colors # possible colors: black, white, green, cyan, red, yellow, magenta -case `hostname -f` in - *.local) +case $HOSTNAME in + *.local|barkley*|bogues*|bryant*|durant*|harden*|ming*|mutombo*|oneal*|robinson*) HOSTCOLOR_BG=magenta HOSTCOLOR_FG=black ;; |