Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
avocent-mac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
sysadmin
avocent-mac
Commits
0c767f4b
Commit
0c767f4b
authored
3 years ago
by
Jakub Pelka
Browse files
Options
Downloads
Patches
Plain Diff
Script
parents
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+4
-0
4 additions, 0 deletions
.gitignore
start-console.py
+100
-0
100 additions, 0 deletions
start-console.py
with
104 additions
and
0 deletions
.gitignore
0 → 100644
+
4
−
0
View file @
0c767f4b
libs/*
libs_dl/*
*.jar
\ No newline at end of file
This diff is collapsed.
Click to expand it.
start-console.py
0 → 100644
+
100
−
0
View file @
0c767f4b
import
xml.etree.ElementTree
as
ET
from
pathlib
import
Path
import
urllib.request
import
os
import
shutil
import
zipfile
print
(
"
#########
"
)
print
(
"
Avocent Console Tool for Mac
"
)
print
(
"
Drag and drop the .jnlp file:
"
)
b
=
input
(
"
>
"
)
print
(
"
|
"
+
b
+
"
|
"
)
if
"
\\
"
in
b
:
b
=
b
.
replace
(
"
\\
"
,
""
)
if
"'"
in
b
:
file
=
b
[
1
:
-
1
]
else
:
file
=
b
if
file
[
-
1
]
==
"
"
:
file
=
file
[:
-
1
]
file_path
=
Path
(
file
)
if
not
file_path
.
is_file
():
print
(
"
File not found
"
)
exit
(
1
)
print
(
""
)
# Get arguments with credentials
arguments
=
[]
libs
=
[]
arguments_string
=
""
tree
=
ET
.
parse
(
file
)
root
=
tree
.
getroot
()
for
elem
in
root
:
for
subelem
in
elem
:
if
subelem
.
tag
==
"
argument
"
:
arguments
.
append
(
subelem
.
text
)
if
subelem
.
tag
==
"
jar
"
:
main_jar
=
subelem
.
attrib
[
"
href
"
]
if
"
os
"
in
elem
.
attrib
:
if
elem
.
attrib
[
"
os
"
]
==
"
Mac\ OS\ X
"
:
for
subelem
in
elem
:
libs
.
append
(
subelem
.
attrib
[
"
href
"
])
print
(
"
Decoding arguments
"
)
for
argument
in
arguments
:
arguments_string
=
arguments_string
+
argument
+
"
"
# Get server domain/IP
server
=
root
.
attrib
[
"
codebase
"
]
print
(
"
Creating directories
"
)
directories
=
[
"
libs
"
,
"
libs_dl
"
]
for
directory
in
directories
:
if
os
.
path
.
isdir
(
directory
):
shutil
.
rmtree
(
directory
)
os
.
mkdir
(
directory
)
print
(
'
Beginning file download with {}...
'
.
format
(
main_jar
))
url
=
server
+
'
/
'
+
main_jar
urllib
.
request
.
urlretrieve
(
url
,
main_jar
)
for
lib
in
libs
:
print
(
'
Beginning file download with {}...
'
.
format
(
lib
))
url
=
server
+
'
/
'
+
lib
urllib
.
request
.
urlretrieve
(
url
,
"
libs_dl/
"
+
lib
)
with
zipfile
.
ZipFile
(
"
libs_dl/
"
+
lib
,
"
r
"
)
as
zip_ref
:
zip_ref
.
extractall
(
"
libs
"
)
print
(
"
Patching libraries
"
)
with
open
(
"
libs/libVMAPI_DLL.jnilib
"
,
'
rb
'
)
as
f
:
s
=
f
.
read
()
f
.
close
()
s
=
s
.
replace
(
b
'
/usr/lib/libssl.dylib
'
,
b
'
/tmp/libssl.1.1.dylib
'
)
with
open
(
"
libs/libVMAPI_DLL.jnilib
"
,
'
wb
'
)
as
w
:
w
.
write
(
s
)
w
.
close
()
print
(
"
Clearing attributes
"
)
os
.
system
(
"
xattr -r -d com.apple.quarantine libs/*.jnilib
"
)
print
(
"
Checking for OpenSSL install
"
)
a
=
os
.
popen
(
"
brew info openssl@1.1
"
).
read
()
if
"
Not installed
\n
"
in
a
:
os
.
system
(
"
brew install openssl@1.1
"
)
print
(
"
OpenSSL found, checking path
"
)
b
=
os
.
popen
(
"
brew info openssl@1.1 | grep $(brew --cellar openssl@1.1)
"
).
read
()
openssl_path
=
b
.
split
(
"
(
"
)[
0
][:
-
1
]
print
(
"
Symlinking OpenSSL libraries
"
)
dylibs
=
[
"
libssl
"
,
"
libcrypto
"
]
for
dylib
in
dylibs
:
if
os
.
path
.
isfile
(
"
/tmp/{}.1.1.dylib
"
.
format
(
dylib
)):
os
.
system
(
"
sudo rm /tmp/{}.1.1.dylib
"
.
format
(
dylib
))
os
.
system
(
"
sudo ln -s {}/lib/{}.1.1.dylib /tmp/{}.1.1.dylib
"
.
format
(
openssl_path
,
dylib
,
dylib
))
print
(
"
Launching!
"
)
os
.
system
(
"
java -cp {} -Djava.library.path=./libs com.avocent.msd.kvm.Main {}
"
.
format
(
main_jar
,
arguments_string
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment