Not exactly graeme, i've just been playing around a little, let me explain
if you set up the following as an exacutable (call it /bin/test) :- #!/bin/bash echo Hello World... read -e THIS_IS_INPUT echo $THIS_IS_INPUT > /home/user/file then add the following line to your /etc/inetd.conf 1025 stream tcp nowait root /bin/test now telnet to the machine on port 1025 and type "this is a test", when you hit return the server will drop the connection, and if you look at /home/user/file, you will see "this is a test" or whatever you typed. I know there are other Dynamic DNS tools out there, but its more fun, and more felxable to write your own, I don't think the others can do everything I want i.e. edit the /etc/hosts file too. If only I'd know a few years ago that you could right a telnet-style server app with a bash script, I would have written a BASH RPG ;-) Rgds, Ian -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 18 March 2002 15:33 To: [EMAIL PROTECTED] Subject: Re: [scottish] DHCP ifconfig dump 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 -------------------------------------------------------------------- ________________________________________________________________________ Scottish Enterprise Network http://www.scottish-enterprise.com Headquarters Address & Contact Numbers 150 Broomielaw 5 Atlantic Quay Glasgow G2 8LU. Tel: +44 (0) 141 248 2700. Fax: +44 (0)141 221 3217 This message is sent in confidence for the addressee only. It may contain legally privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. -------------------------------------------------------------------- http://www.lug.org.uk http://www.linuxportal.co.uk http://www.linuxjob.co.uk http://www.linuxshop.co.uk --------------------------------------------------------------------
