J. Richard Barnette | 556038b | 2014-07-08 14:33:00 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ $# -ne 1 ] |
| 4 | then |
| 5 | echo "usage: $(basename $0) file" >&2 |
| 6 | exit 1 |
| 7 | fi |
| 8 | |
| 9 | FILE=$1 |
| 10 | sed ' |
| 11 | s/^[^ ]* ...[A-Z]* // |
J. Richard Barnette | 3d333e6 | 2014-07-14 14:34:23 -0700 | [diff] [blame^] | 12 | s/ CHROMEOS_RELEASE_VERSION=[^ ]*// |
| 13 | s/ BOARD=[^ ]*// |
| 14 | s/is up/servod &/ |
J. Richard Barnette | 556038b | 2014-07-08 14:33:00 -0700 | [diff] [blame] | 15 | s/.*pwr_button:press.*/power button is stuck down/ |
| 16 | s/^\(not running servod\) \(not running brillo\)$/\1, \2/ |
| 17 | s/^not running servod$/up but not running servod, reason unknown/ |
| 18 | s/^servod not configured$/running brillo, BOARD for &/ |
| 19 | s/^servod failed$/servod running, but not working/ |
| 20 | s/^is down/no answer to ping/ |
| 21 | s/^\(not running servod\) \(ssh is down\)$/\1, ping is up, \2/ |
| 22 | ' $FILE | sort | uniq -c | |
J. Richard Barnette | 3d333e6 | 2014-07-14 14:34:23 -0700 | [diff] [blame^] | 23 | awk '{ print ; sum += $1 } END { printf "%7d total\n", sum }' | |
| 24 | sort | cut -c -72 |