Port exit if masterAuthToken is missing

Exit client.js with a non-zero exit code if it's detected that the
masterAuthToken is missing in the config.

This is a port of 8b4ec58.
This commit is contained in:
Hornwitser committed 2019-10-13 14:45:27 +02:00
1 parent e8d9d160c4
commit 34fc6f0820
1 file changed
+8 -3
+8 -3
View File
@@ -631,9 +631,14 @@ async function startClient() {
// make sure we have the master access token (can't write to master without it since clusterio 2.0)
if(!config.masterAuthToken || typeof config.masterAuthToken !== "string"){
console.error("ERROR invalid config!");
console.error("Master server now needs an access token for write operations. As clusterio slaves depends \
upon this, please add your token to config.json in the field named masterAuthToken. \
You can retrieve your auth token from the master in secret-api-token.txt after running it once.");
console.error(
"Master server now needs an access token for write operations. As clusterio\n"+
"slaves depends upon this, please add your token to config.json in the field\n"+
"named masterAuthToken. You can retrieve your auth token from the master in\n"+
"secret-api-token.txt after running it once."
);
process.exitCode = 1;
return;
}
// messageInterface Management