From 301d8e215dee7149905d23afafd89ac484274c7f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 26 Aug 2019 11:54:53 +0200 Subject: httpdocs/index.php: print error when `gpio` has empty output --- httpdocs/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/httpdocs/index.php b/httpdocs/index.php index f3a8df2..b19b8e9 100644 --- a/httpdocs/index.php +++ b/httpdocs/index.php @@ -8,6 +8,11 @@ if ($f === false) { $l = trim(fgets($f)); pclose($f); +if (empty($l)) { + print 'Cannot read gpio - is it installed?'; + die(); +} + if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on')) $https = true; -- cgit v1.2.3-54-g00ecf