Thomas Vachuska | eef7f3a | 2015-03-18 21:01:04 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #------------------------------------------------------------------------------- |
| 3 | # Test utility to spawn an iTerm window for testing against current cell. |
| 4 | #------------------------------------------------------------------------------- |
| 5 | |
| 6 | cellName=$ONOS_CELL |
Claudine Chiu | 45312d0 | 2016-06-15 13:17:12 +0000 | [diff] [blame] | 7 | nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ') |
Thomas Vachuska | eef7f3a | 2015-03-18 21:01:04 -0700 | [diff] [blame] | 8 | |
| 9 | osascript -e " |
| 10 | tell application \"iTerm\" |
| 11 | |
| 12 | set cellName to \"$cellName\" |
| 13 | set paneCount to $nodeCount |
| 14 | |
| 15 | set theTerm to (make new terminal) |
| 16 | |
| 17 | tell theTerm |
| 18 | set number of columns to 292 |
| 19 | set number of rows to 24 |
| 20 | launch session \"Default\" |
| 21 | tell the current session |
| 22 | set name to \"ONOS Shell 1\" |
| 23 | write text \"cell \" & cellName |
| 24 | write text \"oi 1 && clear && echo Node \$OCI\" |
| 25 | end tell |
| 26 | end tell |
| 27 | |
| 28 | tell theTerm |
| 29 | repeat with thePane from 2 to paneCount |
| 30 | tell the current session |
| 31 | tell application \"System Events\" to keystroke \"d\" using command down |
| 32 | set name to \"ONOS Shell \" & thePane |
| 33 | write text \"cell \" & cellName |
| 34 | write text \"oi \" & thePane & \" && clear && echo Node \$OCI\" |
| 35 | end tell |
| 36 | end repeat |
| 37 | end tell |
| 38 | |
| 39 | tell application \"System Events\" to keystroke \"I\" using command down |
| 40 | |
| 41 | end tell |
| 42 | " |