mirror of
https://github.com/Akkadius/glass-isc-dhcp.git
synced 2025-07-28 16:14:41 +02:00
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
|
||||
*/
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user