blob: b160c6e0a6adb9f19ed8830214563c4d9dec50c0 [file] [log] [blame]
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# Test utility to spawn an iTerm window for monitoring logs of current cell.
4#-------------------------------------------------------------------------------
5
6cellName=$ONOS_CELL
7nodeCount=$(env | egrep "OC[0-9]+" | wc -l | tr -d ' ')
8
9osascript -e "
10tell 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 64
20 launch session \"Default\"
21 tell the current session
22 set name to \"ONOS Log 1\"
23 write text \"cell \" & cellName
24 write text \"oi 1 && clear && echo Node \$OCI && ol\"
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 Log \" & thePane
33 write text \"cell \" & cellName
34 write text \"oi \" & thePane & \" && clear && echo Node \$OCI && ol\"
35 end tell
36 end repeat
37 end tell
38
39 tell application \"System Events\" to keystroke \"I\" using command down
40
41end tell
42"