Docker: added pause/resume commands & container console window

This commit is contained in:
bergware
2018-05-01 16:37:09 +02:00
parent 98f48e0640
commit 69b4c6a494
@@ -92,9 +92,10 @@ switch ($action) {
}
break;
case 'terminal':
exec("kill \$(pgrep -a ttyd|awk '/\/$name\.sock/{print \$1}') 2>/dev/null");
$pid = exec("pgrep -a ttyd|awk '/\\/$name\\.sock/{print \$1}'");
if ($pid) exec("kill $pid");
@unlink("/var/tmp/$name.sock");
exec("exec ttyd -d 0 -i '/var/tmp/$name.sock' docker exec -it '$name' sh &>/dev/null &");
exec("exec ttyd -o -d0 -i '/var/tmp/$name.sock' docker exec -it '$name' sh &>/dev/null &");
break;
default:
$arrResponse = ['error' => "Unknown action '$action'"];