Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for systems where Homebridge service is not running #230

Merged
merged 2 commits into from
May 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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