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 | |
Thomas Vachuska | b51b8bc | 2015-07-27 08:37:12 -0700 | [diff] [blame] | 6 | #sleep 5 && exit 0; |
| 7 | |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 8 | env=$1 && shift |
| 9 | cwd=$1 && shift |
| 10 | |
| 11 | if [ $env != "-" -a $env != "~" ]; then |
| 12 | [ ! -f $env ] && echo "$env file not found" && exit 1 |
| 13 | source $env |
| 14 | fi |
| 15 | |
| 16 | if [ $cwd != "-" ]; then |
| 17 | [ ! -d $cwd ] && echo "$cwd directory not found" && exit 1 |
| 18 | cd $cwd |
| 19 | fi |
| 20 | |
Thomas Vachuska | f9c8436 | 2015-04-15 11:20:45 -0700 | [diff] [blame] | 21 | "$@" 2>&1 |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 22 | status=$? |
| 23 | |
| 24 | [ $env != "~" ] && exit $status |
| 25 | exit 0 |