summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-08-26 11:54:53 +0200
committerErich Eckner <git@eckner.net>2019-08-26 11:54:53 +0200
commit301d8e215dee7149905d23afafd89ac484274c7f (patch)
tree426928153f74d1e07aefaec8b795bafef2d1e42f
parent4f2d0fae19be24404709d280a0add392c8662219 (diff)
downloadraspi-lights-out-301d8e215dee7149905d23afafd89ac484274c7f.tar.xz
httpdocs/index.php: print error when `gpio` has empty output
-rw-r--r--httpdocs/index.php5
1 files changed, 5 insertions, 0 deletions
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;