Advertisement
Grommish

Untitled

Sep 26th, 2020
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. # Set the front LED to on to show boot finished
  2. # Bridge (Orange), Router (Blue), Gateway (Cyan)
  3. filename="/tmp/sysinfo/board_name"
  4.  
  5. while read -r line; do
  6.     mode="$line"
  7. done < "$filename"
  8.  
  9. case $mode in
  10.         "itus,shield-bridge")
  11.                 gpio=9
  12.                 ;;
  13.         "itus,shield-router")
  14.                 gpio=11
  15.                 ;;
  16.         "itus,shield-gateway")
  17.                 gpio=10
  18.                 ;;
  19. esac
  20.  
  21. echo $gpio > /sys/class/gpio/export
  22. echo out > /sys/class/gpio/gpio$gpio/direction
  23. echo 0 > /sys/class/gpio/gpio$gpio/value
  24. echo $gpio > /sys/class/gpio/unexport
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement