diff --git a/core/class/mqtt2.class.php b/core/class/mqtt2.class.php index 58ee8dd..fd78d13 100644 --- a/core/class/mqtt2.class.php +++ b/core/class/mqtt2.class.php @@ -495,6 +495,9 @@ public static function deamon_start() { $mqtt2_path = realpath(dirname(__FILE__) . '/../../resources/mqtt2d'); chdir($mqtt2_path); $authentifications = explode(':', explode("\n", config::byKey('mqtt::password', __CLASS__))[0]); + if (count($authentifications) != 2) { + throw new Exception(__('Aucune autentification trouvée, impossible de lancer le démon', __FILE__)); + } $cmd = system::getCmdSudo() . ' /usr/bin/node ' . $mqtt2_path . '/mqtt2d.js'; $cmd .= ' --loglevel ' . log::convertLogLevel(log::getLogLevel(__CLASS__)); $cmd .= ' --socketport ' . config::byKey('socketport', __CLASS__);