SwaJime has asked for the wisdom of the Perl Monks concerning the following question:
Howdy again,
More info: This is Windows 7 Enterprise running ActivePerl 5.16.3
I've run into another problem.
Whereas before switching to use pageant, this command does not return control to the calling script until the putty window is closed.
putty -ssh -l $user $address -t -m $filenameThis command returns immediately and I have no way of knowing when the putty window is closed by the user.
pageant @ppk_files -c putty -ssh -l $user $address -t -m $filenameThe reason this is a problem is because I'm trying to run two consecutive calls to putty. One to one server setting up data, the second to a second server to process that data, which is not ready until the user closes the first putty session.
Here are sample files to illustrate: In Test1.pl, the second putty window is not opened until the first putty window is closed. This is the desired behavior. In Test2.pl, the second putty window is opened before the first window is closed. This is not good because the data has not been set up yet.
Test1.pl:
#!/usr/bin/perl # use strict; use warnings; system('putty -ssh -l root 192.168.100.2 -t -m C:\Users\JWSIMP~1\AppDa +ta\Local\Temp\BoKFVjf1B9'); system('putty -ssh -l operations 192.168.10.245 -t -m C:\Users\JWSIMP~ +1\AppData\Local\Temp\d60NPopq6A');
Test2.pl:
#!/usr/bin/perl # use strict; use warnings; system('pageant F:\.keys\acuroot_1_8_12_rsa.ppk F:\.keys\acuroot_1_8_1 +3_rsa.ppk -c putty -ssh -l root 192.168.100.2 -t -m C:\Users\JWSIMP~1 +\AppData\Local\Temp\BoKFVjf1B9'); system('pageant F:\.keys\operations_rsa.ppk -c putty -ssh -l operation +s 192.168.10.245 -t -m C:\Users\JWSIMP~1\AppData\Local\Temp\d60NPopq6 +A');
So, long story short ... how can I get that functionality back? I don't want both sessions opening at the same time.
Please forgive me if this is something that is already documented. I have been searching for an answer for quite some time now.
Thanks,
John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to wait for putty to finish before proceeding.
by Mr. Muskrat (Canon) on Feb 11, 2016 at 17:48 UTC | |
by SwaJime (Scribe) on Feb 11, 2016 at 18:30 UTC | |
by Mr. Muskrat (Canon) on Feb 11, 2016 at 20:32 UTC | |
|
Re: How to wait for putty to finish before proceeding.
by atcroft (Abbot) on Feb 11, 2016 at 17:48 UTC | |
|
Re: How to wait for putty to finish before proceeding.
by VinsWorldcom (Prior) on Feb 11, 2016 at 17:45 UTC | |
by SwaJime (Scribe) on Feb 11, 2016 at 17:52 UTC |