X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_bin%2Fmyip;fp=usr_bin%2Fmyip;h=0000000000000000000000000000000000000000;hb=a481de8dab190f141d68e99d22d42ebee44bcddb;hp=1fbe7311985b0c8a977656f6d7760f78faa83575;hpb=1b8dcad8b9da618cb6c0e22a762cafb08e262640;p=grml-scripts-core.git diff --git a/usr_bin/myip b/usr_bin/myip deleted file mode 100755 index 1fbe731..0000000 --- a/usr_bin/myip +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/zsh -# Filename: myip -# Purpose: return IP address of running system on stdout (requires network access) -# Authors: grml-team (grml.org), (c) Alexander Wirt -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -# little helper functions that skips the httpheader of a site -function skip_httpheader { - for i in {1..7} ; do - read -u $REPLY LINE; - if [[ "$LINE" == " " ]] ; then return ; fi - done -} - -zmodload zsh/net/tcp -HOST=v4.showip.spamt.net -ztcp $HOST 80 -print -u $REPLY "GET / HTTP/1.0\r\nHost: $HOST\r\n\r\n" -skip_httpheader -read -u $REPLY LINE -echo "$LINE" -ztcp -c $REPLY - -## END OF FILE #################################################################