Skip to content

Commit

Permalink
same
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Aug 13, 2024
1 parent 3b91846 commit ae62122
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/class/philipsHue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public static function deamon_info() {
$return['state'] = 'nok';
$pid_file = jeedom::getTmpFolder('philipsHue') . '/deamon.pid';
if (file_exists($pid_file)) {
if (trim(file_get_contents($pid_file)) === '') {
shell_exec(system::getCmdSudo() . 'rm -rf ' . $pid_file . ' 2>&1 > /dev/null');
}else if (@posix_getsid((int) trim(file_get_contents($pid_file)))) {
if (trim(file_get_contents($pid_file)) != '' && @posix_getsid((int)trim(file_get_contents($pid_file)))) {
$return['state'] = 'ok';
} else {
if (trim(file_get_contents($pid_file)) != '') {
shell_exec(system::getCmdSudo() . 'rm -rf ' . $pid_file . ' 2>&1 > /dev/null');
}
}
}
$return['launchable'] = 'ok';
Expand Down

0 comments on commit ae62122

Please sign in to comment.