From 2d76beba6177a28677720c020b609e8b8733df69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:40:44 +0200 Subject: [PATCH] remove coordinator backup at deamon start --- core/class/z2m.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/class/z2m.class.php b/core/class/z2m.class.php index aba1c4e..fce9444 100644 --- a/core/class/z2m.class.php +++ b/core/class/z2m.class.php @@ -324,6 +324,9 @@ public static function deamon_start() { $cmd = ''; $cmd .= 'ZIGBEE2MQTT_DATA=' . $data_path; $cmd .= ' npm start --prefix ' . $z2m_path; + if(file_exists($data_path.'/coordinator_backup.json')){ + shell_exec(system::getCmdSudo().' rm -rf'.$data_path.'/coordinator_backup.json'); + } log::add(__CLASS__, 'info', __('Démarrage du démon Z2M', __FILE__) . ' : ' . $cmd); exec(system::getCmdSudo() . $cmd . ' >> ' . log::getPathToLog('z2md') . ' 2>&1 &'); $i = 0;