OK' : 'Error: ' . $response['msg'] . '';
if ($response['type'] == "success") {
break;
}
usleep(1500000);
$retry++;
}
echo (!isset($last_response)) ? 'Already running' : $last_response;
}
if ($_GET['ACTION'] == "stop") {
$retry = 0;
while (docker('sogo-mailcow', 'info')['State']['Running'] == 1 && $retry <= 3) {
$response = docker('sogo-mailcow', 'post', 'stop');
$response = json_decode($response, true);
$last_response = ($response['type'] == "success") ? 'OK' : 'Error: ' . $response['msg'] . '';
if ($response['type'] == "success") {
break;
}
usleep(1500000);
$retry++;
}
echo (!isset($last_response)) ? 'Not running' : $last_response;
}
?>