Merge pull request #20 from maechi/master

getting host_name from /usr/bin/env hostname
This commit is contained in:
Chris Miles 2018-08-15 13:55:37 -05:00 committed by GitHub
commit 391461eeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
app.js
View File

@ -109,7 +109,11 @@ global.socket_clients = 0;
/**
* Server hostname
*/
global.host_name = execSync("cat /etc/hostname").toString().replace("\n", "");
try {
global.host_name = execSync("cat /etc/hostname").toString().replace("\n", "");
} catch (e) {
global.host_name = execSync("/usr/bin/env hostname -s").toString().replace("\n", "");
}
/**
* Pull in core handlers