Beispiel #1
0
    echo "flushing files\nstdout\n";
    flush();
    rewind($p["std_out"]);
    do {
        $line = fgets($p["std_out"], 1024);
        echo "> " . $line;
    } while (!feof($p["std_out"]));
    #    echo "stderr\n";
    #    do {
    #	$line = fgets($p["std_err"], 1024);
    #	echo ">> ".$line."\n";
    #    } while (! feof($p['std_err']) && (strlen($line) != 0));;
    $rmt->ssh_close($p);
}
#$debug_popen = TRUE;
if (isset($debug_popen)) {
    $cout = $rmt->ssh_popen("ls -C", "r");
    echo fread($cout, 8192);
    $rmt->ssh_pclose($cout);
    echo "\n";
    /*
    $cin = $rmt->ssh_popen("/usr/sbin/Mail -s test jr", "w");
       fputs($cin, "\nTest");
       fputs($cin, ".\n");
       fputs($cin, "\004");
    $rmt->ssh_pclose($cin);
    */
}
$rmt->destruct();
echo "</pre>\n\n";
exit;