Discussion:
DOT draw Telnet plugin
John Schultz
2012-12-17 09:27:10 UTC
Permalink
Is there any way to have the telnet session ONLY display one iteration and
then exit automatically?
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Henning Rogge
2012-12-17 09:40:04 UTC
Permalink
You could just close the socket after you receive the beginning of the
second iteration.

Henning Rogge
Post by John Schultz
Is there any way to have the telnet session ONLY display one iteration and
then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
John Schultz
2012-12-17 09:42:53 UTC
Permalink
Henning...

This can be done in a shell script?

-----Original Message-----
From: Henning Rogge [mailto:***@googlemail.com]
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin

You could just close the socket after you receive the beginning of the
second iteration.

Henning Rogge
Post by John Schultz
Is there any way to have the telnet session ONLY display one iteration
and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Henning Rogge
2012-12-17 09:45:24 UTC
Permalink
I would say that depends on your scripting language.

If you want to find out about the layout and links of your mesh, just
use the txtinfo plugin.

Henning Rogge
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of the
second iteration.
Henning Rogge
Post by John Schultz
Is there any way to have the telnet session ONLY display one iteration
and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
John Schultz
2012-12-17 09:49:15 UTC
Permalink
Unfortunately the scope of this project has to have something "pretty" to
show off to the big wigs. The closest thing is the DOT draw plugin.

OK, what about having the plugin do one iteration and then force an exit .
Or is that something done by a script.

BTW, I am planning on using a bash script or maybe expect script

-----Original Message-----
From: Henning Rogge [mailto:***@googlemail.com]
Sent: Monday, December 17, 2012 2:45 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin

I would say that depends on your scripting language.

If you want to find out about the layout and links of your mesh, just use
the txtinfo plugin.

Henning Rogge
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of the
second iteration.
Henning Rogge
On Mon, Dec 17, 2012 at 10:27 AM, John Schultz
Post by John Schultz
Is there any way to have the telnet session ONLY display one
iteration and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Henning Rogge
2012-12-17 09:53:25 UTC
Permalink
Look through the output of the Dotdraw plugin... you will notice you
first get a large block of stuff which ends with a certain line. When
your script read that line, it should stop processing the data and
close the socket.

Henning Rogge
Post by John Schultz
Unfortunately the scope of this project has to have something "pretty" to
show off to the big wigs. The closest thing is the DOT draw plugin.
OK, what about having the plugin do one iteration and then force an exit .
Or is that something done by a script.
BTW, I am planning on using a bash script or maybe expect script
-----Original Message-----
Sent: Monday, December 17, 2012 2:45 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
I would say that depends on your scripting language.
If you want to find out about the layout and links of your mesh, just use
the txtinfo plugin.
Henning Rogge
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of the
second iteration.
Henning Rogge
On Mon, Dec 17, 2012 at 10:27 AM, John Schultz
Post by John Schultz
Is there any way to have the telnet session ONLY display one
iteration and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
John Schultz
2012-12-17 09:57:27 UTC
Permalink
Right, exactly what I was thinking. If I use the expect scripting I can use
the "expect" command to read the Curly bracket, and then the "send" command
to send the control character and exit commands.

John

-----Original Message-----
From: Henning Rogge [mailto:***@googlemail.com]
Sent: Monday, December 17, 2012 2:53 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin

Look through the output of the Dotdraw plugin... you will notice you first
get a large block of stuff which ends with a certain line. When your script
read that line, it should stop processing the data and close the socket.

Henning Rogge
Post by John Schultz
Unfortunately the scope of this project has to have something "pretty"
to show off to the big wigs. The closest thing is the DOT draw plugin.
OK, what about having the plugin do one iteration and then force an exit .
Or is that something done by a script.
BTW, I am planning on using a bash script or maybe expect script
-----Original Message-----
Sent: Monday, December 17, 2012 2:45 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
I would say that depends on your scripting language.
If you want to find out about the layout and links of your mesh, just
use the txtinfo plugin.
Henning Rogge
On Mon, Dec 17, 2012 at 10:42 AM, John Schultz
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of
the second iteration.
Henning Rogge
On Mon, Dec 17, 2012 at 10:27 AM, John Schultz
Post by John Schultz
Is there any way to have the telnet session ONLY display one
iteration and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Henning Rogge
2012-12-17 10:00:07 UTC
Permalink
There is no "exit command" for the dotdraw plugin... it keeps sending
until you close the socket.

Henning Rogge
Post by John Schultz
Right, exactly what I was thinking. If I use the expect scripting I can use
the "expect" command to read the Curly bracket, and then the "send" command
to send the control character and exit commands.
John
-----Original Message-----
Sent: Monday, December 17, 2012 2:53 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
Look through the output of the Dotdraw plugin... you will notice you first
get a large block of stuff which ends with a certain line. When your script
read that line, it should stop processing the data and close the socket.
Henning Rogge
Post by John Schultz
Unfortunately the scope of this project has to have something "pretty"
to show off to the big wigs. The closest thing is the DOT draw plugin.
OK, what about having the plugin do one iteration and then force an exit .
Or is that something done by a script.
BTW, I am planning on using a bash script or maybe expect script
-----Original Message-----
Sent: Monday, December 17, 2012 2:45 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
I would say that depends on your scripting language.
If you want to find out about the layout and links of your mesh, just
use the txtinfo plugin.
Henning Rogge
On Mon, Dec 17, 2012 at 10:42 AM, John Schultz
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of
the second iteration.
Henning Rogge
On Mon, Dec 17, 2012 at 10:27 AM, John Schultz
Post by John Schultz
Is there any way to have the telnet session ONLY display one
iteration and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
John Schultz
2012-12-17 14:52:26 UTC
Permalink
I finally got it working.

I ended up using two scripts, one shell script and one expect script.

The main scrip that controls everything is as follows:
#!/bin/sh

TIMESTAMP=$(date +%m.%d.%Y-%H%M%S)
SERVER='**********'
USER='**********'
PASSWD='**********'

remountrw

./topology.sh > topology-$TIMESTAMP.dot

sed -i 1d topology-$TIMESTAMP.dot
sed -i 1d topology-$TIMESTAMP.dot
sed -i 1d topology-$TIMESTAMP.dot
sed -i 1d topology-$TIMESTAMP.dot

dot -Tpng topology-$TIMESTAMP.dot -o topology-$TIMESTAMP.png

lftp -u $USER,$PASSWD -e "put topology-$TIMESTAMP.png; quit" $SERVER

rm topology-$TIMESTAMP.dot
rm topology-$TIMESTAMP.png

remountro

exit 0

and the second script that actually gets the DOT data is as follows:
#!/usr/bin/expect -f
spawn telnet 127.0.0.1 2004
expect -re "}"
send "\]"
send "quit"


Took me forever to figure out why the script was not logging into the
server, I then realized that I didn't set up forwarding on my firewall
(chuckle). But this does work and ive tested it several times.

Enjoy,
John

-----Original Message-----
From: Henning Rogge [mailto:***@googlemail.com]
Sent: Monday, December 17, 2012 3:00 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin

There is no "exit command" for the dotdraw plugin... it keeps sending until
you close the socket.

Henning Rogge
Post by John Schultz
Right, exactly what I was thinking. If I use the expect scripting I
can use the "expect" command to read the Curly bracket, and then the
"send" command to send the control character and exit commands.
John
-----Original Message-----
Sent: Monday, December 17, 2012 2:53 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
Look through the output of the Dotdraw plugin... you will notice you
first get a large block of stuff which ends with a certain line. When
your script read that line, it should stop processing the data and close
the socket.
Post by John Schultz
Henning Rogge
On Mon, Dec 17, 2012 at 10:49 AM, John Schultz
Post by John Schultz
Unfortunately the scope of this project has to have something "pretty"
to show off to the big wigs. The closest thing is the DOT draw plugin.
OK, what about having the plugin do one iteration and then force an exit .
Or is that something done by a script.
BTW, I am planning on using a bash script or maybe expect script
-----Original Message-----
Sent: Monday, December 17, 2012 2:45 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
I would say that depends on your scripting language.
If you want to find out about the layout and links of your mesh, just
use the txtinfo plugin.
Henning Rogge
On Mon, Dec 17, 2012 at 10:42 AM, John Schultz
Post by John Schultz
Henning...
This can be done in a shell script?
-----Original Message-----
Sent: Monday, December 17, 2012 2:40 AM
To: John Schultz
Cc: olsr users mailing list
Subject: Re: [Olsr-users] DOT draw Telnet plugin
You could just close the socket after you receive the beginning of
the second iteration.
Henning Rogge
On Mon, Dec 17, 2012 at 10:27 AM, John Schultz
Post by John Schultz
Is there any way to have the telnet session ONLY display one
iteration and then exit automatically?
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Steven Hawkings about cosmic inflation: "An increase of billions of billions
of percent in a tiny fraction of a second. Of course, that was before the
present government."
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Loading...