Commit 93d3e864 authored by Ahmad's avatar Ahmad

inikt

parent ce39a670
Pipeline #223 canceled with stages
...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment