200) {
echo "(stalled - backlog of ".$filesinproc." files in ~/BirdSongs/StreamData/)";
return;
}
}
$op = shell_exec("sudo systemctl status ".$name." | grep Active");
if (stripos($op, " active (running)") || stripos($op, " active (mounted)")) {
echo "(active)";
} elseif (stripos($op, " inactive ")) {
echo "(inactive)";
} else {
$status = "ERROR";
if (preg_match("/(\S*)\s*\((\S+)\)/", $op, $matches)) {
$status = $matches[1]. " [" . $matches[2] . "]";
}
echo "($status)";
}
}
?>