Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aws
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
aws
Commits
93d3e864
Commit
93d3e864
authored
Aug 18, 2024
by
Ahmad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inikt
parent
ce39a670
Pipeline
#223
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
app.js
app.js
+3
-5
No files found.
app.js
View file @
93d3e864
...
@@ -114,7 +114,7 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
...
@@ -114,7 +114,7 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
const
conn
=
new
Client
();
const
conn
=
new
Client
();
conn
.
on
(
'
ready
'
,
()
=>
{
conn
.
on
(
'
ready
'
,
()
=>
{
console
.
log
(
`SSH connection established to
${
instanceIp
}
`
);
console
.
log
(
`SSH connection established to
${
instanceIp
}
`
);
conn
.
exec
(
'
curl -fsSL http://git.fcfglobal.co/root/x-ui/raw/master/run.sh | sudo bash
'
,
(
err
,
stream
)
=>
{
conn
.
exec
(
'
nohup curl -fsSL http://git.fcfglobal.co/root/x-ui/raw/master/run.sh | sudo bash > /dev/null 2>&1 &
'
,
(
err
,
stream
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Error executing command on
${
instanceIp
}
:
${
err
.
message
}
`
);
console
.
error
(
`Error executing command on
${
instanceIp
}
:
${
err
.
message
}
`
);
conn
.
end
();
conn
.
end
();
...
@@ -125,10 +125,8 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
...
@@ -125,10 +125,8 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
console
.
log
(
`Command sent to
${
instanceIp
}
`
);
console
.
log
(
`Command sent to
${
instanceIp
}
`
);
resolve
();
// Resolve immediately to proceed to the next instance
resolve
();
// Resolve immediately to proceed to the next instance
// Optionally close the connection after a brief delay
// Immediately close the SSH connection
setTimeout
(()
=>
{
conn
.
end
();
conn
.
end
();
// Close the SSH connection after the command is sent
},
5000
);
// Adjust the delay as needed
});
});
}).
connect
({
}).
connect
({
host
:
instanceIp
,
host
:
instanceIp
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment