diff options
author | Patrick Simianer <p@simianer.de> | 2019-09-05 15:21:28 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2019-09-05 15:21:28 +0200 |
commit | 624fc30b0854412064616da9f527e86694235711 (patch) | |
tree | 76995ce7afbc4ef0cf86736b0505a22800ca6abd | |
parent | 72ec7963c6f967081fa3b55a3d66fe4c482bfe1a (diff) |
zsh: improvements
-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 ;; |