I've a problem with PHP and the SSH-Extension/Net-SSH-Libary. I use it for sending commands to a NetApp-Filer. So I want to create/delete Volumes on the filer. Creation for Volumes is no problem.
But when I want to delete them, the filer ask's for an confirmation ("Are you sure you want to delete.. y/n") and I can't give the NetApp this information. For every exec-Command ist starts a new session.
Is it possible to run more commands in the same session or give them a confirmation of some commands?
My Code (only Volume delete):
<?php
include('Net/SSH2.php');
$ssh = new Net_SSH2('172.22.31.53');
if (!$ssh->login('admin', '12Test')) {
exit('Login Failed');
}
echo $ssh->exec("vol unmount $row->name");
sleep(1);
echo $ssh->exec("vol offline $row->name");
sleep(1);
echo $ssh->exec("vol delete $vol_name \n y");
$loesch = mysqli_query($db, "DELETE FROM volumes WHERE id = '$id'");
header('Location: splash.html');
?>
Thank's in advance!
Greetings