From b98a9bc4dffa33f1f55a6142afa38e43928f6cb2 Mon Sep 17 00:00:00 2001 From: TAj-src <46330209+TAj-src@users.noreply.github.com> Date: Thu, 5 May 2022 10:32:42 +0100 Subject: [PATCH] Create mhlist.exp --- mhlist.exp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 mhlist.exp diff --git a/mhlist.exp b/mhlist.exp new file mode 100644 index 0000000..b244117 --- /dev/null +++ b/mhlist.exp @@ -0,0 +1,49 @@ +#!/usr/bin/expect -f + +set username YOURCALLSIGN +set passwd YOURPASSWORD +set portnum BPQPORTNUMBER + +set timeout 4 + +#spawn ./nodeconnect.sh +spawn telnet 127.0.0.1 8010 + + +expect { + timeout {puts "timed out"; exit} + "user:" +} +send -- "$username\r" + + +expect { + timeout {puts "timed out"; exit} + "password:" +} +send -- "$passwd\r" + +expect { + timeout {puts "timed out"; exit} + "*Press ? For list of commands*" +} +send -- "v\r" + +expect { + timeout {puts "timed out"; exit} + "*\} Version*" +} +send -- "mhv $portnum\rv\r" + +set ::file [ open mhlist.txt w ] + +expect { + timeout {puts "timed out"; exit} + "*\} Version*" + +} +puts -nonewline $::file $expect_out(buffer) + +close $::file + +send -- "b\r"