From: Vincent Date: Thu, 11 Jul 2019 07:05:00 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9af36cd140f81babe07b242f95c799ba494ab04b;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a39bca1..20aa95f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,8 @@ - - + + - + - - + + + + + + + + + + + @@ -61,8 +70,8 @@ - - + + @@ -70,8 +79,8 @@ - - + + @@ -88,48 +97,31 @@ - - + + - + - - + + - - - + - + - - - - - - - - - - - - - - - @@ -254,12 +246,12 @@ @@ -416,7 +408,6 @@ - @@ -467,6 +458,7 @@ + @@ -955,14 +947,8 @@ - - - - 1550481681313 - 1550482889870 @@ -1300,11 +1286,18 @@ - - @@ -1325,7 +1318,7 @@ - + @@ -1350,9 +1343,9 @@ - + - + @@ -1497,13 +1490,6 @@ - - - - - - - @@ -1672,70 +1658,69 @@ - + - - + + - + - - + + - + + + + - - + + - + - - + + - + - - + + - + - - + + - + - + + + - + - - - - - - - - + + - + - - + + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index 07b91ed..4898cb0 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -20,8 +20,11 @@ function cronOneLoop($cronmin) cronWeather($cronmin); cronSqueezeFavorites($cronmin); } - if ($cronmin % 5 == 0) { + + if ($cronmin % 2 == 0) { cronPing($cronmin); + } + if ($cronmin % 5 == 0) { cronMediaLibrary($cronmin); cronTmdb($cronmin); } @@ -107,8 +110,13 @@ function cronPing($cronmin) global $devices; setState('vincenthere', ping('192.168.1.53') ? '1' : '0'); foreach ($devices as $name => $device) { - setState('device_' . $name . '_awake', ping($device['host'], 3, 22) ? '1' : '0'); + $result = ping($device['host'], 3, 22) ? '1' : '0'; + setState('device_' . $name . '_awake', $result); echo 'device_' . $name . '_awake : ' . getState('device_' . $name . '_awake') . "\n"; + if ($result) { + sshCommand('pwd', $device, false, false); + sshCommand('pwd', $device, false, true); + } } echo 'vincenthere : ' . getState('vincenthere') . "\n"; } diff --git a/scripts/lib/ssh.php b/scripts/lib/ssh.php index 7024339..bf87908 100644 --- a/scripts/lib/ssh.php +++ b/scripts/lib/ssh.php @@ -1,6 +1,6 @@ $command, 'device' => $device, 'error' => 'connection failed'); + } + + } $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); stream_set_blocking($errorStream, $blocking);