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