Skip to content

Commit

Permalink
Merge pull request #230 from twa127/master
Browse files Browse the repository at this point in the history
Fix for systems where Homebridge service is not running
  • Loading branch information
pihome-shc authored May 11, 2020
2 parents c009157 + b0c95ab commit 6afd7ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cron/boiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function scanArrayRecursively($arr, $index) {

echo "\033[36m".date('Y-m-d H:i:s'). "\033[0m - Boiler Script Started \n";

$switches = array(); // array of switch zone ids in homebridge config.json
$sensors = array(); // array of sensor zone ids in homebridge config.json
$platform = 0; // flag to indicate if webhooks plugin is present

//check if homebridge service is running
$rval=my_exec("/bin/systemctl status homebridge");
if($rval['stdout']=='') {
Expand All @@ -73,9 +77,6 @@ function scanArrayRecursively($arr, $index) {
if(strstr($line,'active (running)')) {
$stat=trim($line);
// homebridge service is running so check if config.json file exists
$switches = array(); // array of switch zone ids in homebridge config.json
$sensors = array(); // array of sensor zone ids in homebridge config.json
$platform = 0; // flag to indicate if webhooks plugin is present
$path = exec('find /usr/ -name homebridge-http-webhooks'); // path to webhooks directory
$filename = '/var/lib/homebridge/config.json'; // path to config.json
if (file_exists($filename) and file_exists($path)) {
Expand Down

0 comments on commit 6afd7ab

Please sign in to comment.