Files
servicedock/html/action.php
Marc Wäckerlin 4c7ba2a6c5 first release
2015-11-15 23:07:04 +00:00

10 lines
295 B
PHP

<?php
$container=$_REQUEST['container'];
$action=$_REQUEST['action'];
if (!preg_match(',^[a-f0-9]+$,', $container)) exit(1);
if (!preg_match(',start|stop|pause|unpause|rm,', $action)) exit(1);
exec('docker '.$action.' '.$container, $res, $ret);
if ($ret!=0) exit(1);
echo "executed $action";
?>