| @@ -234,30 +234,32 @@ export default class extends Base { | |||||
| await fs.copy(`${dir}/${domain}.crt`, `${dir2}/${domain}.crt`); | await fs.copy(`${dir}/${domain}.crt`, `${dir2}/${domain}.crt`); | ||||
| await fs.copy(`${dir}/${domain}.key`, `${dir2}/${domain}.key`); | await fs.copy(`${dir}/${domain}.key`, `${dir2}/${domain}.key`); | ||||
| } | } | ||||
| } | |||||
| //执行ssh copy | |||||
| let SCP = this.config().SCP; | |||||
| if (SCP && SCP.length > 0) { | |||||
| for (let item of SCP) { | |||||
| scp.scp( | |||||
| `${dir}/${domain}.crt`, | |||||
| { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.crt` }, | |||||
| (err) => { | |||||
| console.log('远程复制失败1:', err); | |||||
| } | |||||
| ); | |||||
| scp.scp( | |||||
| `${dir}/${domain}.key`, | |||||
| { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.key` }, | |||||
| (err) => { | |||||
| console.log('远程复制失败2:', err); | |||||
| } | |||||
| ); | |||||
| } | |||||
| //执行ssh copy | |||||
| let SCP = this.config().SCP; | |||||
| if (SCP && SCP.length > 0) { | |||||
| for (let item of SCP) { | |||||
| scp.scp( | |||||
| `${dir}/${domain}.crt`, | |||||
| { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.crt` }, | |||||
| (err) => { | |||||
| console.log('远程复制失败1:', err); | |||||
| } | |||||
| ); | |||||
| scp.scp( | |||||
| `${dir}/${domain}.key`, | |||||
| { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.key` }, | |||||
| (err) => { | |||||
| console.log('远程复制失败2:', err); | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| // 2. 检查配置 | // 2. 检查配置 | ||||
| execSync('nginx -t'); | execSync('nginx -t'); | ||||