Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,12 @@ app.get('/api/strackerserver/status', function (req, res) {
// post start stracker server
app.post('/api/strackerserver', function (req, res) {
try {
var sTracker = childProcess.spawn('stracker.exe', ['--stracker_ini', 'stracker.ini'], { cwd: sTrackerPath });
if(isRunningOnWindows){
var sTracker = childProcess.spawn('stracker.exe', ['--stracker_ini', 'stracker.ini'], { cwd: sTrackerPath });
} else {
var sTracker = childProcess.spawn('./stracker_linux_x86/stracker', ['--stracker_ini', 'stracker.ini'], { cwd: sTrackerPath });
}
sTrackerServerPid = sTracker.pid;

if (sTrackerServerStatus == 0) {
sTrackerServerStatus = -1;
}
Expand Down Expand Up @@ -995,7 +998,11 @@ app.post('/api/strackerserver', function (req, res) {
app.post('/api/strackerserver/stop', function (req, res) {
try {
if (sTrackerServerPid) {
childProcess.spawn("taskkill", ["/pid", sTrackerServerPid, '/f', '/t']);
if (isRunningOnWindows){
childProcess.spawn("taskkill", ["/pid", sTrackerServerPid, '/f', '/t']);
} else {
childProcess.spawn("kill", [sTrackerServerPid]);
}
sTrackerServerPid = undefined;
}

Expand Down