Advertisement
metalx1000

Kankun Smart Plug Toggle Web CGI httpd

May 7th, 2015
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/sh
  2. echo "Content-type: text/html"
  3. echo ""
  4.  
  5. x=`cat /sys/class/leds/tp-link:blue:relay/brightness`
  6.                                                      
  7. if [ "$x" -eq 0 ]                                    
  8. then                                                  
  9.         echo "<h1>ON</h1>"                            
  10.         echo 1 > /sys/class/leds/tp-link:blue:relay/brightness
  11. else
  12.         echo "<h1>OFF</h1>"
  13.         echo 0 > /sys/class/leds/tp-link:blue:relay/brightness        
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement