;
; whatismyip.com automatic local info configuration
; this my another script by Dj-RuFfy
; Last Edited by Dj-RuFfy
; Thanks To All Friends
on *:start:.disable #wimhost
alias wimip sockclose wimip | sockopen wimip www.whatismyip.com 80
on *:sockopen:wimip:{
if ($sockerr) return
sockwrite -n $sockname GET / HTTP/1.1
sockwrite -n $sockname Host: www.whatismyip.com
sockwrite -n $sockname
}
on *:sockread:wimip:{
if ($sockerr) return
var %t | sockread %t
while ($sockbr) {
if (*
var %ip = $gettok(%t,4,32)
localinfo $iif($host == $null,%ip,$host) %ip
sockclose $sockname
.enable #wimhost
.timer 1 0 .dns $ip
return
}
sockread %t
}
}
on *:sockwrite:wimip:if ($sockerr) return
on *:sockclose:wimip:if ($sockerr) return
#wimhost off
on *:dns:{
if ($dns(1).ip == $ip) .disable #wimhost
if ($dns(1).addr != $null) localinfo $dns(%i).addr $ip
echo -st Local host: $host ( $+ $ip $+ )
}
#wimhost end
Tidak ada komentar:
Posting Komentar