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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 #!/bin/sh
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 # this must run as root
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4
454
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
5 PINS="17 7 24 25"
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 GROUP=fridgeio
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7
454
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
8 for PIN in $PINS; do
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
9 echo $PIN > /sys/class/gpio/export
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10
454
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
11 for f in direction value; do
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
12 fn=/sys/devices/virtual/gpio/gpio$PIN/$f
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
13 chgrp $GROUP $fn
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
14 chmod g+rw $fn
dce9f7841696 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
15 done
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 done