diff options
author | Erich Eckner <git@eckner.net> | 2019-08-26 11:54:53 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-08-26 11:54:53 +0200 |
commit | 301d8e215dee7149905d23afafd89ac484274c7f (patch) | |
tree | 426928153f74d1e07aefaec8b795bafef2d1e42f | |
parent | 4f2d0fae19be24404709d280a0add392c8662219 (diff) | |
download | raspi-lights-out-301d8e215dee7149905d23afafd89ac484274c7f.tar.xz |
httpdocs/index.php: print error when `gpio` has empty output
-rw-r--r-- | httpdocs/index.php | 5 |
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; |