|
@ -522,7 +522,7 @@ function myserverStatus(){ |
|
|
var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8')) |
|
|
var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8')) |
|
|
var mypath = process.cwd() |
|
|
var mypath = process.cwd() |
|
|
|
|
|
|
|
|
var showexec = `./hybrid/scripts/check-wg-connection.sh` |
|
|
var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"` |
|
|
log = spawn(showexec, { |
|
|
log = spawn(showexec, { |
|
|
shell: true, |
|
|
shell: true, |
|
|
cwd: mypath, |
|
|
cwd: mypath, |
|
@ -544,14 +544,28 @@ function myserverStatus(){ |
|
|
var resprivatekey = interfaces[i].ip; |
|
|
var resprivatekey = interfaces[i].ip; |
|
|
var respublickey = interfaces[i].publickey; |
|
|
var respublickey = interfaces[i].publickey; |
|
|
var bootstrapstackid = interfaces[i].stackid; |
|
|
var bootstrapstackid = interfaces[i].stackid; |
|
|
if(intconnection == 'no'){ |
|
|
if(intconnection == 'no'){ |
|
|
var nn = {} |
|
|
var nn = {} |
|
|
nn.connection = interfaces[i].connection; |
|
|
nn.connection = interfaces[i].connection; |
|
|
nn.AllowedIPs = interfaces[i].ip; |
|
|
nn.AllowedIPs = interfaces[i].ip; |
|
|
nn.publickey = interfaces[i].publickey; |
|
|
nn.publickey = interfaces[i].publickey; |
|
|
nn.bootstrapstackid = interfaces[i].stackid; |
|
|
nn.bootstrapstackid = interfaces[i].stackid; |
|
|
console.log('no connection '+JSON.stringify(nn)); |
|
|
console.log('no connection '+JSON.stringify(nn)); |
|
|
} |
|
|
var wgdown = `/bin/bash /config/${nn.bootstrapstackid}/ifdown_linux` |
|
|
|
|
|
var showexec1 = `docker exec swlabadminvenus /bin/bash -c "${wgdown}"` |
|
|
|
|
|
log1 = spawn(showexec1, { |
|
|
|
|
|
shell: true, |
|
|
|
|
|
cwd: mypath, |
|
|
|
|
|
detached: false, |
|
|
|
|
|
stdio: 'pipe' |
|
|
|
|
|
}); |
|
|
|
|
|
log1.on('close', function (code) { |
|
|
|
|
|
console.log('close1 '+JSON.stringify(code)); |
|
|
|
|
|
var n = {} |
|
|
|
|
|
n.data = code |
|
|
|
|
|
io.emit('message_close', n); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|