]> git.saurik.com Git - apple/security.git/blob - Security/sec/SOSCircle/CloudKeychainProxy/scripts/PhoneTerms2.applescript
Security-57031.1.35.tar.gz
[apple/security.git] / Security / sec / SOSCircle / CloudKeychainProxy / scripts / PhoneTerms2.applescript
1 global verticalPos
2 global needVerticalAdjust
3 global desiredInitialVerticalOffset
4
5 on makenewTab given theme:themeName
6 tell application "Terminal"
7 activate
8 tell application "System Events" to keystroke "t" using command down
9 repeat while contents of selected tab of front window starts with linefeed
10 delay 0.01
11 end repeat
12 set current settings of selected tab of front window to first settings set whose name is themeName
13 end tell
14 end makenewTab
15
16 on newPhoneTerm for phoneColor by phonePort
17 set horizontalOffset to 50
18 set height to 180
19 set width to 1800
20 tell application "Terminal"
21 activate
22 if phoneColor is equal to "Red" then
23 set currentTheme to "Red Sands"
24 else if phoneColor is equal to "Green" then
25 set currentTheme to "Grass"
26 else if phoneColor is equal to "Beige" then
27 set currentTheme to "Novel"
28 else if phoneColor is equal to "Black" then
29 set currentTheme to "Pro"
30 else if phoneColor is equal to "Cyan" then
31 set currentTheme to "Cyan"
32 else if phoneColor is equal to "Orange" then
33 set currentTheme to "Orange"
34 else if phoneColor is equal to "Beige" then
35 set currentTheme to "Novel"
36 else
37 set currentTheme to "Ocean"
38 end if
39
40 -- make a new window with the execution of a trivial command
41 do script "clear"
42
43 -- load up the window id of the window we just created
44 -- set window_id to id of first window whose frontmost is true
45 set targetWindow to front window
46 -- Put it on the right hand screen first
47 set position of targetWindow to {horizontalOffset, 0}
48 set position of targetWindow to {horizontalOffset, verticalPos}
49 set size of targetWindow to {width, height}
50 set position of targetWindow to {horizontalOffset, verticalPos}
51 set pos to position of targetWindow
52 if needVerticalAdjust and ((item 2 of pos) is not equal to verticalPos) then
53 set needVerticalAdjust to false
54 set verticalPos to (item 2 of pos) + desiredInitialVerticalOffset
55 set position of targetWindow to {horizontalOffset, verticalPos}
56 end if
57 set verticalPos to verticalPos + height + 15
58
59 set current settings of selected tab of targetWindow to first settings set whose name is currentTheme
60
61
62 -- make tabs 2, 3, 4, 5
63 repeat with i from 1 to 4
64 makenewTab of me given theme:currentTheme
65 end repeat
66
67 -- for each of the five tabs we've now made
68 repeat with i from 1 to 5
69
70 -- build the command, then execute it
71 if i is less than 5 then
72 set myuser to "root"
73 else
74 set myuser to "mobile"
75 end if
76 if (i = 1) then
77 set shcmd to "syslog -w"
78 else if (i = 2) then
79 set shcmd to "ls -1t /var/mobile/Library/Logs/CrashReporter/DiagnosticLogs/security.log.\\*Z \\| head -1 \\| xargs tail -100000F"
80 else if (i = 3) then
81 set shcmd to "ls -1t /var/mobile/Library/Logs/CrashReporter/DiagnosticLogs/security.log.\\*Z \\| head -1 \\| xargs tail -100000F \\| egrep \"'(event|keytrace|peer|coder|engine){}|<Error>'\""
82 else if (i = 4) then
83 set shcmd to "security item -q class=inet,sync=1 \\| grep acct \\| tail -3"
84 else if (i = 5) then
85 set shcmd to ""
86 -- for c in inet genp keys; do for t in "" ,tomb=1; do security item class=$c,sync=1$t; done; done | grep agrp | wc -l
87 else
88 set shcmd to ""
89 end if
90 set custom title of tab i of targetWindow to phoneColor & " " & myuser & " " & phonePort
91 set cmd to "~/bin/sshauser " & "--retry " & phonePort & " " & myuser & " " & shcmd
92 do script cmd in tab i of targetWindow
93
94 end repeat
95
96 end tell
97
98
99 end newPhoneTerm
100
101 --
102 -- main code
103 --
104
105 set desiredInitialVerticalOffset to 10
106 set verticalPos to -10000
107 set needVerticalAdjust to true
108
109 newPhoneTerm of me for "Red" by 11022
110 newPhoneTerm of me for "Blue" by 12022
111 -- newPhoneTerm of me for "Green" by 12022
112 -- newPhoneTerm of me for "Cyan" by 13022
113 -- newPhoneTerm of me for "Orange" by 15022
114 -- newPhoneTerm of me for "Beige" by 16022
115 -- newPhoneTerm of me for "Black" by 21022
116
117 -- # Config file for ssh
118 -- #UDID 79003b34516ba80b620e3d947e7da96e033bed48 johnsrediphone 10022
119 -- #UDID 96476595e5d0ef7496e8ff852aedf4725647960b johnsblueiphone 11022
120 -- #UDID b674745cb6d2a1616a065cddae7207f91980e95d johnsgreentouch 12022
121 -- #UDID a489e67286bc2a509ef74cda67fc6696e2e1a192 johnscyanmini 13022
122 -- #UDID df86edbd280fd986f1cfae1517e65acbac7188cd johnsyellowmini 14022
123 -- #UDID 16d4c2e0a63083ec16e3f2ed4f21755b12deb900 johnsorangemini 15022
124 -- #UDID 8b2aa30e1ead1c7c303c363216bfe44f1cb21ce6 johnsbeigeipad 16022
125 -- #UDID f80b8fbf11ca6b8d692f10e9ea29dea1e57fcbdf johnswhiteipad 17022
126