diff --git a/core/class/philipsHue.class.php b/core/class/philipsHue.class.php index b42d184..c11ab89 100644 --- a/core/class/philipsHue.class.php +++ b/core/class/philipsHue.class.php @@ -34,12 +34,10 @@ public static function deamon_info() { $return['state'] = 'nok'; $pid_file = jeedom::getTmpFolder('philipsHue') . '/deamon.pid'; if (file_exists($pid_file)) { - if (@posix_getsid((int) trim(file_get_contents($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)))) { $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';