-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROD-US-ADOBE-LOG.scpt
38 lines (33 loc) · 1.2 KB
/
PROD-US-ADOBE-LOG.scpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set hostnames to {"va1-p2-flnkm-11", "va1-p2-flnkm-12", "va1-p2-flnkw-11", "va1-p2-flnkw-12", "va1-p2-flnkw-13","va1-p2-flnkw-14"}
if application "iTerm" is running then
tell application "iTerm"
--creating new window
create window with default profile
delay 1
--starting loop
set num_hosts to count of hostnames
set num_tabs to count of hostnames
repeat with n from 1 to num_hosts
--current tab
tell current tab of current window
select
tell current session
write text "ssh " & (item n of hostnames) & ".ctcolo.dom"
if ((item n of hostnames) contains "flnkw") then
write text "tail -f /opt/flink/log/flink-root-taskexecutor-0-" & (item n of hostnames) & ".log"
end if
end tell
end tell
delay 1
--creating new tab
if num_tabs > 1 then
tell current window
create tab with default profile
set num_tabs to num_tabs - 1
end tell
end if
end repeat
end tell
else
activate application "iTerm"
end if