Re: IP in the Windows registry

From: Michele Andreoli (
Date: Thu Nov 21 2002 - 22:34:21 CET

On Wed, Nov 20, 2002 at 11:19:32PM -0000, Dave Houghton nicely wrote:

> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
> Tcpip\Parameters\Interfaces\adapterID

I'm uploading a new version of rustic-shell.exe. I added some new command in /bin
and the file


This file contains VAR=VALUE pairs and allow a first basic form of
configuration. Edit it with notepad.

I added the important feature I was searching for: to find the current
IPaddress of the machine, scanning the Windows registry with this simple script:

# (C) 2002 M.Andreoli

# try to find my current IP
# scanning Windows registry


for x in $DIR/*/IpAddress ; do
        BASE=$(dirname $x)
        IP=$(cat $BASE/IpAddress)
        DG=$(cat $BASE/DefaultGateway)
        if [ "$DG" ] && [ "$IP" != "" ] ; then
                echo $IP; exit

echo ""


This is only my first attempt to do that, because in this part of the Windows
registry I found a lot of (un)configured network interfaces. So, I assumed the
right one as the interface with IP!= and a DefaultGateway set.

Please, Dave, check if this mechanism may works in general.

If the system fetch a good IP, it send the IP, via email, to the address
set in the config.txt: NOTIFY_IP_TO.
You can disable this feature using a blank email.
Please, edit this file and put in it *your* address, removing mine.

The IP is sent automagically only if you run the sshd.bat script.

As previous stated, this feature is required by Paolo, my friend in


"Physics is like sex: it may give some practical
results, but that's not why we do it"  (Richard Feynman)
To unsubscribe, e-mail:
For additional commands, e-mail:

This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:23 CET