use hostname binary if we don't find an /etc/hostname
This commit is contained in:
parent
8b83cf4fed
commit
f32eefe31a
6
app.js
6
app.js
|
@ -109,7 +109,11 @@ global.socket_clients = 0;
|
||||||
/**
|
/**
|
||||||
* Server hostname
|
* 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
|
* Pull in core handlers
|
||||||
|
|
Loading…
Reference in New Issue