annotate py/setup_gpio.sh @ 461:1eb68df9f8ab
Add daemon mode with locking, add "disabled" parameter
author |
Matt Johnston <matt@ucc.asn.au> |
date |
Fri, 11 Jan 2013 23:41:56 +0800 |
parents |
dce9f7841696 |
children |
659953f2ee03 |
rev |
line source |
447
|
1 #!/bin/sh |
|
2 |
|
3 # this must run as root |
|
4 |
454
|
5 PINS="17 7 24 25" |
447
|
6 GROUP=fridgeio |
|
7 |
454
|
8 for PIN in $PINS; do |
|
9 echo $PIN > /sys/class/gpio/export |
447
|
10 |
454
|
11 for f in direction value; do |
|
12 fn=/sys/devices/virtual/gpio/gpio$PIN/$f |
|
13 chgrp $GROUP $fn |
|
14 chmod g+rw $fn |
|
15 done |
447
|
16 done |