Managing user LEDs by using Bash Scripting language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
497 B

3 years ago
3 years ago
3 years ago
  1. #! /bin/bash
  2. LED3_PATH=/sys/class/leds/beaglebone:green:usr3
  3. function removeTrigger
  4. {
  5. echo "none" >> "$LED3_PATH/trigger"
  6. }
  7. echo "Starting the LED Bash Script"
  8. if [ $# != 1 ]; then
  9. echo "Error: There is an incorrect number of arguments. Try:"
  10. echo -e "\nbashLED [argument]\n\nwhere command is:"
  11. echo -e "on, off, blink or status\n\ne.g. bashLED on"
  12. exit 2
  13. fi
  14. echo "The argument passed is: $1"
  15. if [ "$1" == "on" ]; then
  16. echo "LED on"
  17. removeTrigger
  18. echo "1" >> "$LED3_PATH/brightness"
  19. fi