From 33915f55cc2760d70046b3b8caa74e905100ceb0 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Wed, 14 Jul 2010 09:41:55 +0200 Subject: Several things: * Change color * Change font * Add fip() --- zsh/zshrc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'zsh/zshrc') diff --git a/zsh/zshrc b/zsh/zshrc index e6477f0..9995da7 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -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 ~/ -- cgit v1.2.3