It's been a while since I worked on the mail script. 

I think I see the problem. In the mail script it is the mail server that 
breaks the connection with mnc, not the other way around. What you want is 
for mnc to break the connection with your server. Unfortunately, I don't 
know how to do this directly. Somebody else might.

However, there is another rather crude way that I think will work. 

<code>
echo $data | mnc $address $port &
pid=$!
sleep 5
kill $pid
</code>

What this does is
1)run mnc as a background task 
2)saves the background task PID
3)sleeps 5 seconds
4)kills the background task (mnc)

At 01:45 AM 07/03/2001 +0100, Tim Hicks wrote:

>Hello all, this is my first time over in this neck of the woods (having
>lurked on the linux-router list for a long time).
>
>I'm running EigerStein Beta2 with extended scripts v1.0, but I'm not really
>sure that any of that is relevant.
>
>My problem is that I have a cable modem connection that does not come with a
>static ip address.  As I run a DMZ server that I need to have accessible, my
>plan is to run a script (daily with the log cleanups or each time dhcpclient
>receives a new lease? how would I do that) that uses mnc to transfer the
>output of 'ip route' to my DMZ server, where I have a basic python server
>waiting to do things with the information.  So, here is the script that I
>have,
>
>----begin very basic script----
>#!/bin/sh
>
>data=$(ip route)
>
>address="192.168.2.2"
>port="55555"
>
>echo $data | mnc $address $port
>
>exit 0
>----end script----
>
>This does what I want it to do, except it just waits to do anything until I
>hit control+c.  I can see this when looking at my server output.  It's like
>the mnc transfer is not completed until I hit control+c.  I've looked
>through Mike Sensney's mail script here
>(http://users.owt.com/msensney/lrp/mail), but I'm totally new to shell
>scripting, and don't really understand how it works.  If someone could tell
>me how I can make this script not require user intervention, I'd really
>appreciate it.
>
>thanks
>
>tim
>
>ps If you happen to know how I can execute my script each time I get an ip
>lease, that would be great too :-)
>
>
>_______________________________________________
>Leaf-user mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/leaf-user
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.263 / Virus Database: 135 - Release Date: 06/22/2001

Reply via email to