From 576a5266716bcfc75c71a8ba008e4a52c6e10a6b Mon Sep 17 00:00:00 2001 From: "barraux.a" Date: Mon, 14 Nov 2022 17:54:16 +0100 Subject: [PATCH] 3.141592653589793238 --- api/get_light.php | 0 api/set_light.php | 4 ++-- assets/index.62d9ce6a.js | 0 assets/index.8b2241a3.css | 0 index.html | 0 scripts/set_light.sh | 10 ++++++++-- 6 files changed, 10 insertions(+), 4 deletions(-) mode change 100644 => 100755 api/get_light.php mode change 100644 => 100755 api/set_light.php mode change 100644 => 100755 assets/index.62d9ce6a.js mode change 100644 => 100755 assets/index.8b2241a3.css mode change 100644 => 100755 index.html diff --git a/api/get_light.php b/api/get_light.php old mode 100644 new mode 100755 diff --git a/api/set_light.php b/api/set_light.php old mode 100644 new mode 100755 index ce7334d..a4c9c42 --- a/api/set_light.php +++ b/api/set_light.php @@ -2,5 +2,5 @@ $light = $_GET["light"]; $output = null; exec('bash ../scripts/set_light.sh '.$light, $output); -var_dump($output); -?> \ No newline at end of file +echo $output[0]; +?> diff --git a/assets/index.62d9ce6a.js b/assets/index.62d9ce6a.js old mode 100644 new mode 100755 diff --git a/assets/index.8b2241a3.css b/assets/index.8b2241a3.css old mode 100644 new mode 100755 diff --git a/index.html b/index.html old mode 100644 new mode 100755 diff --git a/scripts/set_light.sh b/scripts/set_light.sh index 0f13e3a..1459bf6 100755 --- a/scripts/set_light.sh +++ b/scripts/set_light.sh @@ -1,5 +1,11 @@ #!/bin/bash gpio mode $1 out let "out=`gpio read $1`" -gpio write $1 $out -echo $out +if [ $out = 0 ] +then + gpio write $1 1 + echo 1 +else + gpio write $1 0 + echo 0 +fi