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.
 

23 lines
497 B

#! /bin/bash
LED3_PATH=/sys/class/leds/beaglebone:green:usr3
function removeTrigger
{
echo "none" >> "$LED3_PATH/trigger"
}
echo "Starting the LED Bash Script"
if [ $# != 1 ]; then
echo "Error: There is an incorrect number of arguments. Try:"
echo -e "\nbashLED [argument]\n\nwhere command is:"
echo -e "on, off, blink or status\n\ne.g. bashLED on"
exit 2
fi
echo "The argument passed is: $1"
if [ "$1" == "on" ]; then
echo "LED on"
removeTrigger
echo "1" >> "$LED3_PATH/brightness"
fi