Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/usr/bin/env sh
  2.  
  3. hour=$(date +%H)
  4. dev=/sys/devices/platform/leds-gpio/leds/tp-link:blue:system
  5.  
  6. echo phy0rx > $dev/trigger
  7.  
  8. if [ $hour -ge 22 ]; then
  9. echo 'turn off led'
  10. echo 0 > $dev/brightness
  11. else
  12. echo 'turn on led'
  13. echo 225 > $dev/brightness
  14. fi
  15.  
  16. # */5 * * * * /bin/sh /root/led
  17. # /etc/init.d/cron start
  18. # /etc/init.d/cron enable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement