root / trunk / swipe / runtron.sh @ 296
History | View | Annotate | Download (593 Bytes)
| 1 | #!/bin/sh |
|---|---|
| 2 | |
| 3 | #TODO: better way to know the path |
| 4 | cd /home/rc99/officers/tooltron/trunk/swipe |
| 5 | |
| 6 | while /bin/true |
| 7 | do |
| 8 | ./tooltron.py `ls /dev/ttyUSB*` |
| 9 | |
| 10 | echo "tooltron exited, waiting for log to catch up" |
| 11 | sleep 2 |
| 12 | if [ $? ] ; then |
| 13 | cat /home/tooltron/screenlog.? > screenlog |
| 14 | tail -n 100 screenlog > body.txt |
| 15 | uuencode screenlog screenlog > attach.txt |
| 16 | cat body.txt attach.txt > combined.txt |
| 17 | mail -s "tooltron ERROR" rc-tooltron@lists.andrew.cmu.edu < combined.txt |
| 18 | rm body.txt |
| 19 | rm attach.txt |
| 20 | rm combined.txt |
| 21 | rm screenlog |
| 22 | fi |
| 23 | echo "exited, restarting" |
| 24 | |
| 25 | done |
| 26 | |
| 27 | echo "tooltron script exiting" |