Skip to content

Commit

Permalink
Json output provides
Browse files Browse the repository at this point in the history
Readme update.
  • Loading branch information
Vitexus committed May 24, 2024
1 parent 57ba18b commit 9c77f8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Pohoda Client config
====================
Pohoda Client Checker
=====================

![ Pohoda Client Config logo]( pohoda-client-checker.svg?raw=true)

Expand All @@ -14,6 +14,8 @@ Return code: 0

Return code: 1

The json output into stdout is also provided.

Installation
------------

Expand Down
3 changes: 2 additions & 1 deletion src/pohoda-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PHPmServer - Pohoda Access probe
*
* @author Vítězslav Dvořák <[email protected]>
* @copyright (C) 2023 Vitex Software
* @copyright (C) 2023-2024 Vitex Software
*/
require_once '../vendor/autoload.php';
\Ease\Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD'], array_key_exists(1, $argv) && file_exists($argv[1]) ? $argv[1] : '../.env');
Expand All @@ -18,4 +18,5 @@

$result = $client->isOnline();
$client->addStatusMessage(_('Connection') . ' ' . ($result ? 'OK' : 'problem'), $result ? 'success' : 'error');
echo json_encode($result === false);
exit($result === false ? 1 : 0);

0 comments on commit 9c77f8a

Please sign in to comment.