diff options
author | Stefan Ritter <xeno@thehappy.de> | 2010-07-14 09:41:55 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2010-07-14 09:41:55 +0200 |
commit | 33915f55cc2760d70046b3b8caa74e905100ceb0 (patch) | |
tree | 8cc737f1f751c4e3673c7de3e14607a37da037c6 | |
parent | 31e24fa922c7ac2fd3e3057869bfd5eca50697c5 (diff) |
Several things:
* Change color
* Change font
* Add fip()
-rw-r--r-- | zsh/zshrc | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -1,3 +1,5 @@ +#w +#w #PUSER=%{$(echo -n '\e[0;37m')%}%n #PATKI=%{$(echo -n '\e[0;37m')%}@ #PHOST=%{$(echo -n '\e[1;33m')%}%m @@ -115,4 +117,51 @@ cp_p() END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 } +fip() { + SUBNET="" + if [[ $1 =~ ^[a-z][0-9][0-9][0-9]$ ]]; then + if [ "$(echo $1 | cut -c 1)" = "a" ]; then + SUBNET='amber' + elif [ "$(echo $1 | cut -c 1)" = "b" ]; then + SUBNET='blue' + elif [ "$(echo $1 | cut -c 1)" = "c" ]; then + SUBNET='cyan' + elif [ "$(echo $1 | cut -c 1)" = "g" ]; then + SUBNET='green' + elif [ "$(echo $1 | cut -c 1)" = "i" ]; then + SUBNET='indigo' + elif [ "$(echo $1 | cut -c 1)" = "j" ]; then + SUBNET='jade' + elif [ "$(echo $1 | cut -c 1)" = "k" ]; then + SUBNET='khaki' + elif [ "$(echo $1 | cut -c 1)" = "l" ]; then + SUBNET='lemmon' + elif [ "$(echo $1 | cut -c 1)" = "m" ]; then + SUBNET='magenta' + elif [ "$(echo $1 | cut -c 1)" = "o" ]; then + SUBNET='orange' + elif [ "$(echo $1 | cut -c 1)" = "p" ]; then + SUBNET='purple' + elif [ "$(echo $1 | cut -c 1)" = "r" ]; then + SUBNET='red' + elif [ "$(echo $1 | cut -c 1)" = "s" ]; then + SUBNET='silver' + elif [ "$(echo $1 | cut -c 1)" = "u" ]; then + SUBNET='umbra' + elif [ "$(echo $1 | cut -c 1)" = "w" ]; then + SUBNET='white' + elif [ "$(echo $1 | cut -c 1)" = "y" ]; then + SUBNET='yellow' + else + echo "Error: Unknown subnet" + fi + + if [ $SUBNET ]; then + ping $1.$SUBNET.fastwebserver.de | grep from + fi + else + echo "Syntax error: need char + 3 integer!" + fi +} + cd ~/ |