root / scout_gumstix / etc / rc.local @ d2acabf3
History | View | Annotate | Download (578 Bytes)
1 | 83163372 | Tom Mullins | #!/bin/sh -e |
---|---|---|---|
2 | # |
||
3 | # rc.local |
||
4 | # |
||
5 | # This script is executed at the end of each multiuser runlevel. |
||
6 | # Make sure that the script will "exit 0" on success or any other |
||
7 | # value on error. |
||
8 | # |
||
9 | # In order to enable or disable this script just change the execution |
||
10 | # bits. |
||
11 | # |
||
12 | # By default this script does nothing. |
||
13 | |||
14 | export_as_output() { |
||
15 | last_dir="$PWD" |
||
16 | cd /sys/class/gpio |
||
17 | echo "$1" > export |
||
18 | cd "gpio$1" |
||
19 | echo out > direction |
||
20 | chgrp gpio value |
||
21 | a0644b40 | Tom Mullins | chmod g+w value |
22 | 83163372 | Tom Mullins | cd "$last_dir" |
23 | } |
||
24 | |||
25 | # export motor driver gpio pins |
||
26 | for i in 70 71 72 73 74 75 76 77; do |
||
27 | export_as_output $i |
||
28 | done |
||
29 | |||
30 | exit 0 |