Thomas Vachuska | f9c8436 | 2015-04-15 11:20:45 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #------------------------------------------------------------------------------- |
| 3 | # System Test Coordinator process launcher |
| 4 | #------------------------------------------------------------------------------- |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 5 | |
| 6 | env=$1 && shift |
| 7 | cwd=$1 && shift |
| 8 | |
| 9 | if [ $env != "-" -a $env != "~" ]; then |
| 10 | [ ! -f $env ] && echo "$env file not found" && exit 1 |
| 11 | source $env |
| 12 | fi |
| 13 | |
| 14 | if [ $cwd != "-" ]; then |
| 15 | [ ! -d $cwd ] && echo "$cwd directory not found" && exit 1 |
| 16 | cd $cwd |
| 17 | fi |
| 18 | |
Thomas Vachuska | f9c8436 | 2015-04-15 11:20:45 -0700 | [diff] [blame] | 19 | "$@" 2>&1 |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 20 | status=$? |
| 21 | |
| 22 | [ $env != "~" ] && exit $status |
| 23 | exit 0 |