Check for access to TeamSpeak3 binary on startup.

develop
Icedream 2015-10-16 08:22:20 +02:00
parent 6ed562e279
commit cb42c3afd2
1 changed files with 6 additions and 0 deletions

View File

@ -7,11 +7,17 @@ TS3Settings = require("../ts3settings")
TS3ClientQuery = require("../ts3query")
path = require "path"
merge = require "merge"
fs = require "fs"
spawn = require("child_process").spawn
StreamSplitter = require("stream-splitter")
require_bin = require("../require_bin")
ts3client_binpath = require_bin path.join(config.get("ts3-install-path"), "ts3client_linux_" + (if process.arch == "x64" then "amd64" else process.arch))
if not path.exists
await fs.access ts3client_binpath, fs.R_OK | fs.X_OK, defer err
if err
log.fatal "Can't access TeamSpeak3 client binary at #{ts3client_binpath}, does the binary exist and have you given correct access?"
throw new Error "Access to TeamSpeak3 binary failed."
module.exports = class TS3ClientService extends services.Service
dependencies: [