|
|
|
@@ -239,18 +239,26 @@ export default class extends Base { |
|
|
|
|
|
|
|
if (SCP && SCP.length > 0) { |
|
|
|
for (let item of SCP) { |
|
|
|
scp.scp( |
|
|
|
await scp.scp( |
|
|
|
`${dir}/${domain}.crt`, |
|
|
|
{ host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.crt` }, |
|
|
|
(err) => { |
|
|
|
console.log('远程复制失败1:', err); |
|
|
|
if(err){ |
|
|
|
console.log('远程复制失败1:', err); |
|
|
|
}else{ |
|
|
|
console.log('远程复制成功1:'); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
scp.scp( |
|
|
|
await scp.scp( |
|
|
|
`${dir}/${domain}.key`, |
|
|
|
{ host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.key` }, |
|
|
|
(err) => { |
|
|
|
console.log('远程复制失败2:', err); |
|
|
|
if(err){ |
|
|
|
console.log('远程复制失败2:', err); |
|
|
|
}else{ |
|
|
|
console.log('远程复制成功2:'); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
@@ -275,7 +283,7 @@ export default class extends Base { |
|
|
|
stream.on('data', data => console.log('输出:', data.toString())) |
|
|
|
.stderr.on('data', data => console.error('错误:', data.toString())) |
|
|
|
.on('close', code => { |
|
|
|
console.log(`退出码: ${code}`); |
|
|
|
console.log(`${item.host}退出码: ${code}`); |
|
|
|
conn.end(); // 关闭连接 |
|
|
|
}); |
|
|
|
}); |
|
|
|
|