- 論壇徽章:
- 0
|
本帖最后由 unixthisyear 于 2012-07-13 14:46 編輯
- if ( "$Server_type" eq "master" ){
- #print $Path_to_install_command;
- $install = Expect->spawn( $Path_to_install_command ) or die "Couldn't spawn, $!";
-
- $install->expect(600, # set timeout
- [ qr/Do you wish to continue?/,
- sub { my $self = shift; $self->send("y\r"); exp_continue;} ],
- ....
- ....
- [ qr/That file can be deleted after you are sure the install was successful./,
- sub { my $self = shift; $self->send("\r"); exp_continue;} ],
- );
- $install->soft_close();
- exit 0;
- }
復制代碼 手動安裝時,執(zhí)行到最后一步,按回車程序就正常退出了,回到shell提示符。
但是用這個腳本安裝時,到最后一步會停住,每次都是手動ctrl+c去退出。 |
|