i got problem with my script using ssh2.

i connect to the server using ssh connection after login successfully i need to connect to the localhost OAM to check some status. using this script i already got what i want. but the problem is i cant close the ssh connection.

when i run this script, the process was stuck so i need to send C at the cli to finish this process.

here's the code :

<?php

$con=ssh2_connect('xxxxx', 22);
ssh2_auth_password($con, "xxx", "xxx");
$shell=@ssh2_shell($con, 'bash');
fwrite( $shell, "telnet 0 54332 > cir.txt\n");
fwrite( $shell, "prompt\n");
fwrite( $shell, "link status *\n");
fwrite( $shell, "exit\n");
fwrite( $shell, "exit\n");
stream_set_blocking($shell, true);
$output = stream_get_contents($shell);

?>

    Write a Reply...