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) {
const conn = new Client();
conn.on('ready', () => {
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) {
console.error(`Error executing command on ${instanceIp}: ${err.message}`);
conn.end();
......@@ -125,10 +125,8 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
console.log(`Command sent to ${instanceIp}`);
resolve(); // Resolve immediately to proceed to the next instance
// Optionally close the connection after a brief delay
setTimeout(() => {
conn.end(); // Close the SSH connection after the command is sent
}, 5000); // Adjust the delay as needed
// Immediately close the SSH connection
conn.end();
});
}).connect({
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