Commit 27bfb3f5 authored by Administrator's avatar Administrator

Update app.js

parent c06e8d6e
Pipeline #119 failed with stages
...@@ -8,7 +8,7 @@ const cronSpeed = require('node-cron'); ...@@ -8,7 +8,7 @@ const cronSpeed = require('node-cron');
const shellExec = require('shell-exec') const shellExec = require('shell-exec')
var decimalPointRegex = /\-?\d+\.\d+/g; var decimalPointRegex = /\-?\d+\.\d+/g;
let fs = require('fs') let fs = require('fs')
let port = 5 let port = 443
let countReboot = 4 let countReboot = 4
...@@ -63,10 +63,7 @@ async function run() { ...@@ -63,10 +63,7 @@ async function run() {
let portRes = await getPort() let portRes = await getPort()
portRes=parseInt(portRes) portRes=parseInt(portRes)
console.log(portRes) console.log(portRes)
if (portRes === 0 || portRes === 443 || portRes ===5)
port = randomInt(4000, 60000)
else
port = parseInt(portRes)
let a = await shell.exec('cd .. && cd mt && sudo ./server1.sh ' + port, {silent: true}).stdout; let a = await shell.exec('cd .. && cd mt && sudo ./server1.sh ' + port, {silent: true}).stdout;
console.log('Reset Proxy') console.log('Reset Proxy')
} }
......
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