forked from NathanVaughn/powerpanel-business-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-remote.exp
303 lines (299 loc) · 14.3 KB
/
install-remote.exp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Fri Nov 5 14:11:41 2021
# Expect and autoexpect were both written by Don Libes, NIST.
#
# Note that autoexpect does not guarantee a working script. It
# necessarily has to guess about certain things. Two reasons a script
# might fail are:
#
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
# etc.) and devices discard or ignore keystrokes that arrive "too
# quickly" after prompts. If you find your new script hanging up at
# one spot, try adding a short sleep just before the previous send.
# Setting "force_conservative" to 1 (see below) makes Expect do this
# automatically - pausing briefly before sending each character. This
# pacifies every program I know of. The -c flag makes the script do
# this in the first place. The -C flag allows you to define a
# character to toggle this mode off and on.
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
#
# 2) differing output - Some programs produce different output each time
# they run. The "date" command is an obvious example. Another is
# ftp, if it produces throughput statistics at the end of a file
# transfer. If this causes a problem, delete these patterns or replace
# them with wildcards. An alternative is to use the -p flag (for
# "prompt") which makes Expect only look for the last line of output
# (i.e., the prompt). The -P flag allows you to define a character to
# toggle this mode off and on.
#
# Read the man page for more info.
#
# -Don
set timeout -1
spawn ./ppb-linux-x86_64.sh
match_max 100000
expect -exact "Unpacking JRE ...\r
Starting Installer ...\r
\[?7hPlease select a language:\r
1: Chinese (Simplified)\r
2: Chinese (Traditional)\r
3: Croatian\r
4: Czech\r
5: English \[Enter\]\r
6: French\r
7: German\r
8: Japanese\r
9: Polish\r
10: Spanish\r
\[1 - 10\]\r
"
send -- "\r"
expect -exact "\r
This will install CyberPower PowerPanel Business on your computer.\r
OK \[o, Enter\], Cancel \[c\]\r
"
send -- "o\r"
expect -exact "o\r
Click Next to continue, or Cancel to exit Setup.\r
Please read the following License Agreement. You must accept the terms of\r
this agreement before continuing with the installation.\r
\r
ELECTRONIC END USER LICENSE AGREEMENT FOR CYBERPOWER POWERPANEL\r
\r
NOTICE TO USER:\r
\r
PLEASE READ THIS SOFTWARE LICENSE AGREEMENT (\"LICENSE\") CAREFULLY BEFORE\r
USING THE CYBERPOWER SOFTWARE. BY USING THE CYBERPOWER SOFTWARE, YOU ARE\r
AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO\r
THE TERMS OF THIS LICENSE, DO NOT INSTALL AND/OR USE THE CYBERPOWER SOFTWARE\r
AND, IF PRESENTED WITH THE OPTION TO \"AGREE\" OR \"DISAGREE\" TO THE TERMS,\r
CLICK \"DISAGREE\". IF YOU ACQUIRED THE CYBERPOWER SOFTWARE AS PART OF AN\r
CYBERPOWER HARDWARE PURCHASE AND IF YOU DO NOT AGREE TO THE TERMS OF THIS\r
LICENSE, YOU MAY RETURN THE ENTIRE CYBERPOWER HARDWARE/SOFTWARE PACKAGE\r
WITHIN THE RETURN PERIOD TO THE STORE OR DISTRIBUTOR WHERE YOU OBTAINED IT\r
FOR A REFUND, SUBJECT TO ANY APPLICABLE RETURN POLICY. YOU MUST RETURN THE\r
ENTIRE HARDWARE/ SOFTWARE PACKAGE IN ORDER TO OBTAIN A REFUND.\r
\r
THIS IS A CONTRACT. BY INSTALLING THIS SOFTWARE YOU ACCEPT ALL THE TERMS AND\r
CONDITIONS OF THIS AGREEMENT. The End User License Agreement and copyright\r
of CyberPower PowerPanel(R) product and related explanatory materials\r
(\"Software\") are owned by Cyber Power Systems (USA), Inc. and its affiliates\r
(\"CyberPower\"). The term \"Software\" also shall include any upgrades,\r
modified versions or updates of the Software licensed to you by Cyber Power\r
Systems (USA), Inc. and its affiliates. Please read this Agreement\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
carefully. At the end, you will be asked to accept this agreement and\r
continue to install or, if you do not wish to accept this Agreement, to\r
decline this agreement, in which case you will not be able to use the\r
Software.\r
\r
Upon your acceptance of this Agreement, Cyber Power Systems (USA), Inc. and\r
its affiliates grants to you a nonexclusive license to use the Software\r
subject to the terms of this License Agreement. This Software is being\r
licensed, not sold, to you by CyberPower under the terms of this License.\r
CyberPower and/or CyberPower's licensors retain ownership of the CyberPower\r
Software itself and reserve all rights not expressly granted to you.\r
\r
License Terms:\r
\r
1. Use of the Software. You may install the Software on a hard disk or other\r
storage device; install and use the Software on a file server for use on a\r
network for the purposes of (i) permanent installation onto hard disks or\r
other storage devices or (ii) use of the Software over such network; and\r
make backup copies of the Software.\r
\r
You may make and distribute unlimited copies of the Software, including\r
copies for commercial distribution, as long as each copy that you make and\r
distribute contains this Agreement, the CyberPower PowerPanel(R) installer,\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
and the same copyright and other proprietary notices pertaining to this\r
Software that appear in the Software. If you download the Software from the\r
Internet or similar on-line source, you must include the copyright notice\r
for the Software with any on-line distribution and on any media you\r
distribute that includes the Software.\r
\r
2. Copyright and Trademark Rights. The Software is owned by Cyber Power\r
Systems (USA), Inc., its affiliates, its suppliers, and its structure,\r
organization and code are the valuable trade secrets of its Cyber Power\r
Systems (USA), Inc. and its affiliates and its suppliers. The Software also\r
is protected by United States Copyright Law and International Treaty\r
provisions. You may use trademarks only insofar as required to comply with\r
Section 1 of this Agreement and to identify printed output produced by the\r
Software, in accordance with accepted trademark practice, including\r
identification of trademark owner's name. Such use of any trademark does not\r
give you any rights of ownership in that trademark. Except as stated above,\r
this Agreement does not grant you any intellectual property rights in the\r
Software.\r
\r
3. Restrictions. You agree not to modify, adapt, translate, reverse\r
engineer, decompile, disassemble or otherwise attempt to discover the source\r
code of the Software. Although you may customize the installer for the\r
Software as documented on the CyberPower PowerPanel(R) Disk (e.g.,\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
installation of additional plug-in and help files), you may not otherwise\r
alter or modify the installer program or create a new installer for the\r
Software.\r
\r
4. Disclaimer of Warranties. The Software is being delivered to you AS IS\r
and its supplier makes no warranty as to its use or performance. CYBER POWER\r
SYSTEMS (USA), INC., ITS AFFILIATES AND ITS SUPPLIERS DO NOT AND CANNOT\r
WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE OR\r
DOCUMENTATION. CYBER POWER SYSTEMS (USA), INC., ITS AFFILIATES, AND ITS\r
SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO NONINFRINGEMENT OF\r
THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE.\r
IN NO EVENT WILL CYBER POWER SYSTEMS (USA), INC., ITS AFFILIATES OR ITS\r
SUPPLIERS BE LIABLE TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR SPECIAL\r
DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, EVEN IF CYBER POWER\r
SYSTEMS (USA), INC. REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF\r
SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY.\r
\r
YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY\r
APPLICABLE LAW, USE OF THE CYBERPOWER SOFTWARE AND ANY SERVICES PERFORMED BY\r
OR ACCESSED THROUGH THE CYBERPOWER SOFTWARE IS AT YOUR SOLE RISK AND THAT\r
THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT\r
IS WITH YOU.\r
\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
CYBERPOWER DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE\r
CYBERPOWER SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR\r
SERVICES PERFORMED OR PROVIDED BY, THE CYBERPOWER SOFTWARE WILL MEET YOUR\r
REQUIREMENTS, THAT THE OPERATION OF THE CYBERPOWER SOFTWARE OR SERVICES WILL\r
BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE\r
AVAILABLE, THAT THE CYBERPOWER SOFTWARE OR SERVICES WILL BE COMPATIBLE OR\r
WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES, OR\r
THAT DEFECTS IN THE CYBERPOWER SOFTWARE OR SERVICES WILL BE CORRECTED.\r
INSTALLATION OF THIS CYBERPOWER SOFTWARE MAY AFFECT THE AVAILABILITY AND\r
USABILITY OF THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES, AS\r
WELL AS CYBERPOWER PRODUCTS AND SERVICES.\r
\r
YOU FURTHER ACKNOWLEDGE THAT THE CYBERPOWER SOFTWARE AND SERVICES ARE NOT\r
INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE\r
OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN THE CONTENT, DATA OR\r
INFORMATION PROVIDED BY, THE CYBERPOWER SOFTWARE OR SERVICES COULD LEAD TO\r
DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE,\r
INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT\r
NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR\r
WEAPONS SYSTEMS.\r
\r
NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY CYBERPOWER OR A CYBERPOWER\r
AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SHOULD THE CYBERPOWER\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
SOFTWARE OR SERVICES PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL\r
NECESSARY SERVICING, REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW\r
THE EXCLUSION OF IMPLIED WARRANTIES OR LIMITATIONS ON APPLICABLE STATUTORY\r
RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSION AND LIMITATIONS MAY NOT APPLY\r
TO YOU.\r
\r
Some states or jurisdictions do not allow the exclusion or limitation of\r
incidental, consequential or special damages, or the exclusion of implied\r
warranties or limitations on how long an implied warranty may last, so the\r
above limitations may not apply to you.\r
\r
5. Consent to Use of Data.\r
A. Diagnostic and Usage Data. If you choose to allow diagnostic and usage\r
collection, you agree that CyberPower may collect, maintain, process and use\r
diagnostic, technical, usage and related information, including but not\r
limited to unique system or hardware identi?ers, information about your\r
computer, system and application software, and peripherals, that is gathered\r
periodically to provide and improve CyberPower's products and services,\r
facilitate the provision of software updates, product support and other\r
services to you (if any) related to the CyberPower Software, and to verify\r
compliance with the terms of this License.\r
\r
B. CyberPower may use this information, as long as it is collected in a form\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
that does not personally identify you, for the purposes described above. To\r
enable CyberPower's partners and third party developers to improve their\r
software, hardware and services designed for use with CyberPower products,\r
CyberPower may also provide any such partner or third party developer with a\r
subset of diagnostic information that is relevant to that partner's or\r
developer's software, hardware and/or services, as long as the diagnostic\r
information is in a form that does not personally identify you.\r
\r
C. Privacy Policy. At all times your information will be treated in\r
accordance with CyberPower's Privacy Policy, which can be viewed at:\r
https://www.cyberpowersystems.com/company/privacy-policy/\r
\r
6. Governing Law and General Provisions. This Agreement will be governed by\r
the laws of the State of Minnesota, U.S.A., excluding the application of its\r
conflicts of law rules. This Agreement will not be governed by the United\r
Nations Convention on Contracts for the International Sale of Goods, the\r
application of which is expressly excluded. If any part of this Agreement is\r
found void and unenforceable, it will not affect the validity of the balance\r
of the Agreement, which shall remain valid and enforceable according to its\r
terms. You agree that the Software will not be shipped, transferred or\r
exported into any country or used in any manner prohibited by the United\r
States Export Administration Act or any other export laws, restrictions or\r
regulations. This Agreement shall automatically terminate upon failure by\r
\[Enter\]\r
"
send -- "\r"
expect -exact "\r
you to comply with its terms. This Agreement may only be modified in writing\r
signed by an authorized officer of Cyber Power Systems (USA), Inc.\r
\r
7. Compliance with Law; Export Control. You will comply with all national\r
and international laws, rules and regulations that apply to the Software and\r
your use of the Software as well as end-user, end-use and destination\r
restrictions issued by the United States or other governments. You agree\r
that the Software will not be shipped, transferred, exported or re-exported\r
into any country or used in any manner prohibited by the United States\r
Export Administration Act or any other export laws, restrictions or\r
regulations. In particular, but without limitation, the Software may not be\r
exported or re-exported (a) into any U.S. embargoed countries or (b) to\r
anyone on the U.S. Treasury Department's list of Specially Designated\r
Nationals or the U.S. Department of Commerce Denied Person's List or Entity\r
List. By using the Software, you represent and warrant that you are not\r
located in any such country or on any such list. You also agree that you\r
will not use the Software for any purposes prohibited by United States law\r
and the applicable laws where you are located, including, without\r
limitation, the development, design, manufacture or production of missiles\r
or nuclear, chemical or biological weapons.\r
\r
\r
I accept the agreement\r
Yes \[1\], No \[2\]\r
"
send -- "1\r"
expect -exact "1\r
Select the folder where you would like CyberPower PowerPanel Business to be\r
installed, then click Next.\r
Where should CyberPower PowerPanel Business be installed?\r
\[/usr/local/PPB\]\r
"
send -- "\r"
expect -exact "\r
Which components should be installed?\r
1: Local\r
2: Remote\r
Please enter a comma-separated list of the selected values or \[Enter\] for the default selection:\r
"
send -- "2\r"
expect eof