1
0
This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.

41 lines
1.3 KiB
JavaScript

var is = require("electron-is");
var pass = localStorage.getItem('password');
function GETLISTWORLD() {
console.log('world get list inicialized')
var exec = require('child_process').exec;
var command1 = 'echo ' + pass + '|sudo -S ' + 'bds-switch get gui'
var child = exec( command1, {
shell: true
});
child.stdout.on('data', function (data) {
var str;
str = data.toString();
str = str.replace(/\r?\n|\r/g, "");
var e = document.getElementById("worldselect");
e.innerHTML += data;
console.log(data)
});
console.log('world get list complete')
}
GETLISTWORLD();
function latestworld() {
var exec = require('child_process').exec;
var child = exec('cat /etc/BDS-Common/server.properties|grep "level-name="|sed "s|level-name=||g"', {
shell: true
});
child.stdout.on('data', function (data) {
document.getElementById("worldselect").value= (data);
console.log(data)
});
}
latestworld();
function teste() {
var selectMPA = document.getElementById('selectMPA').value
var exec = require('child_process').exec;
var child = exec('echo ' + pass + ' |sudo -S ' + 'bds-switch set man' + ' ' + selectMPA , {
shell: true
});
child.stdout.on('data', function (data) {
document.getElementById('LOG').value += (data)
});
}