Commit f4565678 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent e8c46a5d
......@@ -60,7 +60,8 @@ app.listen(3000, () => console.log(`Example app listening on port 3000!`))
async function run() {
let data=await getPort()
port=parseInt(data)
let a = await shell.exec('cd .. && cd mt && sudo ./server1.sh ' + port, {silent: true}).stdout;
let gen=await getGenerationStatus()
let a = await shell.exec('cd .. && cd mt && sudo ./server1.sh ' + port +' '+gen, {silent: true}).stdout;
console.log('Reset Proxy')
}
......@@ -176,6 +177,18 @@ function getPort() {
}
function getGenerationStatus() {
const request = require('request');
let url = 'http://admin.fcfglobal.co:3000/generationStatus'
return new Promise(function (resolve, reject) {
request(url, {timeout: 15000}, function (error, res, body) {
resolve(body)
});
});
}
function getWhiteIp() {
const request = require('request');
let url = 'http://admin.fcfglobal.co:3000/getWhiteIp'
......
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