From 445ba5e7aecf1288d24385d9cb93e1de32e1cef7 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sat, 24 Oct 2020 13:49:25 +0200 Subject: [PATCH] check if command is emptry --- pages/do.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/do.php b/pages/do.php index 8f3be4a..e635dc4 100644 --- a/pages/do.php +++ b/pages/do.php @@ -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'); + } } }