From 346561804e513ccc94cdb4aac1edc115ecbdb059 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 7 Feb 2024 15:03:26 +0100 Subject: [PATCH] . --- .docker/docker-compose.yml | 2 ++ .docker/dockerterminal.bat | 2 +- .idea/php.xml | 2 +- .idea/workspace.xml | 69 +++++++++++++++++++++----------------- bin/updatedns.bat | 3 +- scripts/lib/heartbeats.php | 12 +++++-- 6 files changed, 52 insertions(+), 38 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index a63339a..2222e47 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -55,6 +55,8 @@ services: - '/dev/bus/usb:/dev/bus/usb' - './src/.docker/config/php/php.ini:/etc/php/7.4/fpm/conf.d/00-php-override.ini' - './src/.docker/config/php/fpm.conf:/etc/php/7.4/fpm/pool.d/zz-overrides.conf' + tmpfs: + - /tmp networks: - tortugahome extra_hosts: diff --git a/.docker/dockerterminal.bat b/.docker/dockerterminal.bat index b7a7a21..11ec468 100644 --- a/.docker/dockerterminal.bat +++ b/.docker/dockerterminal.bat @@ -1,3 +1,3 @@ @echo off cls -C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.6 'docker exec -it -u root tortugahome /bin/bash' +C:\tools\cygwin\bin\ssh.exe -tt root@home.tortuga.enhydra.fr 'docker exec -it -u root tortugahome /bin/bash' diff --git a/.idea/php.xml b/.idea/php.xml index 1c633bc..0d655dc 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -158,7 +158,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd4f78e..d88927b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,12 @@ + + + + + - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "Shell Script.Docker terminal.executor": "Run", - "WebServerToolWindowFactoryState": "true", - "WebServerToolWindowPanel.toolwindow.highlight.mappings": "true", - "WebServerToolWindowPanel.toolwindow.highlight.symlinks": "true", - "WebServerToolWindowPanel.toolwindow.show.date": "false", - "WebServerToolWindowPanel.toolwindow.show.permissions": "false", - "WebServerToolWindowPanel.toolwindow.show.size": "false", - "deletionFromPopupRequiresConfirmation": "false", - "git-widget-placeholder": "master", - "ignore.virus.scanning.warn.message": "true", - "kotlin-language-version-configured": "true", - "last_opened_file_path": "D:/Works/rodadocavaco", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "project.structure.last.edited": "Project", - "project.structure.proportion": "0.0", - "project.structure.side.proportion": "0.2", - "ruby.rails.projectView.checked": "true", - "settings.editor.selected.configurable": "preferences.pluginManager", - "vue.rearranger.settings.migration": "true" + +}]]> @@ -278,7 +284,7 @@ - + diff --git a/bin/updatedns.bat b/bin/updatedns.bat index 186796b..5e56252 100644 --- a/bin/updatedns.bat +++ b/bin/updatedns.bat @@ -1,5 +1,4 @@ @echo off -C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.6 '/usr/local/bin/updatedns' -C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.7 '/usr/local/bin/updatedns' +C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.66 '/usr/local/bin/updatedns' C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.64 '/usr/local/bin/updatedns' C:\tools\cygwin\bin\ssh.exe -tt root@192.168.13.67 '/usr/local/bin/updatedns' \ No newline at end of file diff --git a/scripts/lib/heartbeats.php b/scripts/lib/heartbeats.php index f36a491..df3c38b 100644 --- a/scripts/lib/heartbeats.php +++ b/scripts/lib/heartbeats.php @@ -25,7 +25,8 @@ function isAlive($device) function checkDevicesAlive() { - $devices = ['litvincent', 'litjerome', 'bureausun', 'entree', 'sdb', 'cuisine', 'chambre']; + $devices = ['litvincent', 'litjerome', 'bureausun', /*'entree',*/ + 'sdb', 'cuisine', 'chambre']; header('Content-Type: text/plain'); foreach ($devices as $device) { echo $device . ':' . isAlive($device) . '(' . getState('heartbeat_' . $device) . ')' . "\n"; @@ -39,7 +40,7 @@ function restartDeadDevices() 'litjerome' => ['room' => 'chambre', 'type' => 'rpi', 'eco' => false], 'chambre' => ['room' => 'chambre', 'type' => 'rpi', 'eco' => false], 'bureausun' => ['room' => 'bureau', 'type' => 'rpi', 'eco' => false], - 'entree' => ['room' => 'entree', 'type' => 'rpi', 'eco' => true], + 'entree' => ['room' => 'entree', 'type' => 'rpi-no-reboot', 'eco' => false], 'cuisine' => ['room' => 'cuisine', 'type' => 'android', 'eco' => true], 'salon' => ['room' => 'salon', 'type' => 'android', 'eco' => true], 'sdb' => ['room' => 'sdb', 'type' => 'android', 'eco' => true], @@ -60,7 +61,7 @@ function restartDeadDevices() if ($infos['type'] === 'android') { phoneTask('Tortuga', $device); echo 'Restart android app on ' . $device . "\n"; - } else { + } else if ($infos['type'] === 'rpi') { if ($alive === 0 || getNightMode($device)) { sshCommand('/usr/local/bin/tortugahome', $device, false, true); echo 'Restart kiosk chrome on ' . $device . "\n"; @@ -68,6 +69,11 @@ function restartDeadDevices() sshCommand('/sbin/reboot now', $device, false, true); echo 'Reboot rpi ' . $device . "\n"; } + } else if ($infos['type'] === 'rpi-no-reboot') { + if ($alive <= 0 || getNightMode($device)) { + sshCommand('/usr/local/bin/tortugahome', $device, false, true); + echo 'Restart kiosk chrome on ' . $device . "\n"; + } } } } \ No newline at end of file -- 2.39.5