const child_process = require('child_process');
var rconProc = () => {
console.log('[Website] Startup rcon worker...');
let process = child_process.fork(`${__dirname}/rcon.js`);
process.on('close', () => {
console.log("Rcon worker stopped! Restarting worker in " + cfg.rcon.timeout + ' seconds');
setTimeout(() => rconProc(), cfg.rcon.timeout*1000);
})
}
rconProc()
const Rcon = require('rcon');
console.log('Worker started!');
let rconCon = new Rcon('localhost', 25575, '12341');
rconCon.on('auth', function() {
console.log("[Website(rcon)] Rcon connection created");
})
.on('response', function(data) {})
.on('end', function() {
console.log("[Website(rcon)] Socket closed!");
});
rconCon.connect();
while true
do
java -server -Xmx512M -Xms512M -Dfile.encoding=UTF-8 -jar BungeeCord.jar
echo "To stopping the server, press the key combination Ctrl + C!"
echo "Reboot:"
for i in 5 4 3 2 1
do
echo "$i..."
sleep 1
done
echo "Reboot complete!"
done
[program:bungee]
command=/root/server/game/bungee/Start.sh
autostart=true
autorestart=true