X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_bin%2Fmyip;h=1fbe7311985b0c8a977656f6d7760f78faa83575;hb=5b0c6b200fe0a76b7a78c984733defdb3120ea6a;hp=0f77d5a60559f951dd8599b2627f4bf90e45853c;hpb=e720deae78f1eda5e6f62629606c194f16796762;p=grml-scripts.git diff --git a/usr_bin/myip b/usr_bin/myip index 0f77d5a..1fbe731 100755 --- a/usr_bin/myip +++ b/usr_bin/myip @@ -4,18 +4,20 @@ # Authors: grml-team (grml.org), (c) Alexander Wirt # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Aug 07 23:39:32 CEST 2006 [mika] ################################################################################ # little helper functions that skips the httpheader of a site function skip_httpheader { - for i in {1..6} ; do read -u $REPLY LINE; done + for i in {1..7} ; do + read -u $REPLY LINE; + if [[ "$LINE" == " " ]] ; then return ; fi + done } zmodload zsh/net/tcp -HOST=showip.spamt.net +HOST=v4.showip.spamt.net ztcp $HOST 80 -print -u $REPLY "GET / HTTP/1.1\r\nHost: $HOST\r\n\r\n" +print -u $REPLY "GET / HTTP/1.0\r\nHost: $HOST\r\n\r\n" skip_httpheader read -u $REPLY LINE echo "$LINE"