diff --git a/Readme.md b/Readme.md index e69de29..a3aecf1 100644 --- a/Readme.md +++ b/Readme.md @@ -0,0 +1,11 @@ +Readme + +This project is a Bash script to modify the user3 LED status by using the command `bashLED` and +passing an argument `on`, `off`, `blink`, or `status`. + +The `status` argument will send back the current status and will not modify it. + +Gerardo Marx Chavez-Campos +13/04/2021 + +Mobile-Devices diff --git a/bashLED.sh b/bashLED.sh index 773e77c..2585260 100755 --- a/bashLED.sh +++ b/bashLED.sh @@ -4,12 +4,20 @@ LED3_PATH=/sys/class/leds/beaglebone:green:usr3 function removeTrigger { -echo 'none' >> '$LED3_PATH/trigger' +echo "none" >> "$LED3_PATH/trigger" } echo "Starting the LED Bash Script" if [ $# != 1 ]; then - echo "Error: There is an incorrect number of arguments." + 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 \ No newline at end of file