<?php
$file = file_get_contents("/system/status"); //Get status file
$output = json_decode($file); //Decode it into variables
$render1 = 0; //Declare variables
$render2 = 0;
if ($output->render1 & $output->render2) //If variable not available, do not replace
{
$render1 = $output->render1;
$render2 = $output->render2;
}
if ($render1 || $render2 != 1 || 2 || 3) //If value is zero, item is corrupt
{
echo "Status file is corrupt or unavailable"; ***** This always runs, no matter
*******what the actual value
}
if ($render1 == 1)
{
echo "Render 1 is up and running";
}
if ($render2 == 1)
{
echo "Render 2 is up and running";
}
if ($render1 == 2)
{
echo "Render 1 is offline";
}
if ($render2 == 2)
{
echo "Render 2 is offline";
}
if ($render1 == 3)
{
echo "Render 1 is offline for scheduled maintinance";
}
if ($render2 == 3)
{
echo "Render 2 is offline for scheduled maintinance";
}
?>
If the $render1 and $render2 variables are 1, my program would outputStatus file is corrupt or unavailable Render 1 is up and running Render 2 is up and running
Any ideas?


Sign In
Create Account

Back to top









