Not my field of expertise at all Ian, but there was an article on devshed
recently about Socket Programming with PHP (unfortunately DevShed seem to
be having trouble with their servers again at present).
Basically, the article gave examples of using PHP to create daemons that
listened at specific ports. This sounds like what you are proposing to
do. I have no idea if it is possible to use a shell script in the way
that you are suggesting, so if that is not possible, PHP may be worth
considering.
HTH
Graeme
"Ian Drake, IT, SE Dunbartonshire" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
18/03/02 14:17
Please respond to scottish
To: "SLUG (E-mail)" <[EMAIL PROTECTED]>
cc:
Subject: [scottish] DHCP ifconfig dump
NTL are doing my head in, my cable modem IP has change 3 times in the last
month so I'm looking at writting a few scripts to make my life easier.
I have 3 linux machines which I access.
Machine X (which I own and has a fixed IP, I'm root)
Machine Y(the one on the cable modem, also mine and root)
Machine Z(a friend's fixed IP machine which I have a standard user account
on)
Z is my primary DNS server and X is my secondry.
I was thinking of a BASH script on Y to get it's current IP, and telnet to
another bash script (running via inetd.conf) on machine Y, that would then
update it's own /etc/hosts file and dump the IP into a standard bind zone
files (updating the serial) and ftp it onto machine Z.
The key point here is a inetd.conf batchfile that listens on a specific
port
until it recieves a specific string followed by an IP address, can I use
the
"line" command in this kind of demon?
Am I trying to reinvent the wheel here?
Any thoughts or comments would be welcome.
Rgds,
Ian
--------------------------------------------------------------------
http://www.lug.org.uk http://www.linuxportal.co.uk
http://www.linuxjob.co.uk http://www.linuxshop.co.uk
--------------------------------------------------------------------