Advertisement
Guest User

Turris Omnia LED

a guest
Oct 24th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cd /sys/devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/i2c-1/1-002b/leds
  4.  
  5. echo 0 | tee omnia-led:all/autonomous
  6. echo "255" | tee omnia-led:all/brightness
  7.  
  8. leds=( {power,lan{0,1,2,3,4},wan,pci{1,2,3},user{1,2}} )
  9. colors=( {255-{0,127,255}-0,{255,127,0}-255-0,0-{255-0,127-127,0-255},0-{0,127,255}-255,{63-0-127,127-0-255}} )
  10.  
  11. while sleep 0.01; do
  12.   i=$(($i+1))
  13.   echo $(echo ${colors[$(($i%${#colors[*]}))]} | tr '-' ' ') | tee omnia-led\:${leds[$(($i%${#leds[*]}))]}/color
  14.   #echo $(echo ${colors[$(($RANDOM%${#colors[*]}))]} | tr '-' ' ') | tee omnia-led\:${leds[$(($i%${#leds[*]}))]}/color
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement