summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2010-07-14 09:41:55 +0200
committerStefan Ritter <xeno@thehappy.de>2010-07-14 09:41:55 +0200
commit33915f55cc2760d70046b3b8caa74e905100ceb0 (patch)
tree8cc737f1f751c4e3673c7de3e14607a37da037c6
parent31e24fa922c7ac2fd3e3057869bfd5eca50697c5 (diff)
Several things:
* Change color * Change font * Add fip()
-rw-r--r--zsh/zshrc49
1 files changed, 49 insertions, 0 deletions
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 ~/