Files
webgui/plugins/dynamix.docker.manager/Docker.page
Squidly271 c53790cdc6 Display message if docker service fails to start
Occasionally, the array is started but the docker service fails to start (unmountable docker.img as an example)  
Toss up a message instead of simply displaying a blank page
2017-12-09 12:55:13 -05:00

27 lines
915 B
Plaintext

Menu="Tasks:60"
Type="xmenu"
Cond="exec(\"grep -o '^DOCKER_ENABLED=.yes' /boot/config/docker.cfg 2>/dev/null\")"
----
<?PHP
/* Copyright 2005-2017, Lime Technology
* Copyright 2014-2017, Guilherme Jardim, Eric Schultz, Jon Panozzo.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<?
if ($var['fsState'] != "Started") {
echo "<p class='notice'>Array must be <span class='strong big'>started</span> to view Docker containers.</p>";
return;
}
if ( !is_file('/var/run/dockerd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/dockerd.pid'))) ) {
echo "<p class='notice'>Docker Service failed to start.</p>";
exit;
}
?>