check if command is emptry

This commit is contained in:
Christopher 2020-10-24 13:49:25 +02:00
parent 2000f98b70
commit 445ba5e7ae
1 changed files with 7 additions and 3 deletions

View File

@ -36,9 +36,13 @@ if(isset($_SESSION['LOGIN']))
{
$filename = "/tmp/command".time().".txt";
$command = trim($_REQUEST['commandtext']);
file_put_contents($filename, $command);
exec('cat '.$filename.' | socat EXEC:"docker attach '.$container['Id'].'",pty STDIN');
if($command != "")
{
file_put_contents($filename, $command);
exec('cat '.$filename.' | socat EXEC:"docker attach '.$container['Id'].'",pty STDIN');
}
}
}