TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

automatic telnet etc



Well, I've got some things working. My .procmail looks like this: (Your
other suggestion didn't work because procmail had problems with a "(" in
the *^Received line, so I just did this and used sed) But this is
fundamentally the same.


:0
*^Received: from hearing
{
     :0 c
     mail/hearing

     :0
     |getip
}                 


This sucessfully puts the e-mail in ~/mail/hearing, and runs getip. 

getip is:

grep "Received: from hearing" ~/mail/hearing >~/getip.txt
address=`cat ~/getip.txt | sed "s:^[^\@]*\@\([^)]*\)):\1:" `
echo $address
echo $address>~/serverip.txt
xterm -display pclueyb.res.carleton.edu:0.0 -e telnet $address
export $address     

The problem is that ~/serverip.txt (and hence $address) is a list of all
the ip addresses that fit. If I have three messages in hearing, I have 3
ip address in $address with a space inbetween them. This is easy to fix
because I can just keep hearing empty. My other problem is that I can't
get telnet to automatically login I can give it the username, but there
isn't a switch for password. Right now, it just gives up after a while and
disconnects from the server, unless I can type the password in time. 

Thanks so much, I'm very close and this is very cool.

Ben

P.S. I figured out that xterm won't load unless I let is where to display
-- took me a while, I'm pround I fixed it.