Skip to content

Commit

Permalink
fix: force waitFileExist
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotfirenet committed Jul 10, 2024
1 parent 3934fcb commit 9396506
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions plugin_info/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ function luna_install() {
usleep(500000);
}
}
if($waitFileExist){
$isLte = shell_exec('sudo cat /boot/jeedomLTE');
if(trim($isLte) == "2"){
config::save('isLte', 'NOLTE', 'luna');
} else {
config::save('isLte', 'LTE', 'luna');
}
} else {
$waitFileExist = true;
}
if($waitFileExist){
$isLte = shell_exec('sudo cat /boot/jeedomLTE');
if(trim($isLte) == "2"){
config::save('isLte', 'NOLTE', 'luna');
} else {
config::save('isLte', 'LTE', 'luna');
}
}
}
Expand Down Expand Up @@ -129,12 +131,15 @@ function luna_update() {
while (time() - $startTime < $maxWaitTime) {
$result = shell_exec('sudo test -f /boot/jeedomLTE && echo "exists" || echo "not exists"');
if(trim($result) != "exists"){
log::add('luna', 'debug', 'Wait for jeedomLTE file');
$waitFileExist = true;
break;
}else{
usleep(500000);
}
}
} else {
$waitFileExist = true;
}
if($waitFileExist){
$isLte = shell_exec('sudo cat /boot/jeedomLTE');
Expand All @@ -144,4 +149,4 @@ function luna_update() {
config::save('isLte', 'LTE', 'luna');
}
}
}
}

0 comments on commit 9396506

Please sign in to comment.