diff options
author | Minteck <contact@minteck.org> | 2022-11-28 17:31:34 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-11-28 17:31:34 +0100 |
commit | 7923aa8942b55884320ef2428417e3ee4b121613 (patch) | |
tree | 7993632f2898b1998f25b11ce40a8d2eb3d44730 /StartupItems/200--Hostname.js | |
download | mistyos-og-7923aa8942b55884320ef2428417e3ee4b121613.tar.gz mistyos-og-7923aa8942b55884320ef2428417e3ee4b121613.tar.bz2 mistyos-og-7923aa8942b55884320ef2428417e3ee4b121613.zip |
Diffstat (limited to 'StartupItems/200--Hostname.js')
-rw-r--r-- | StartupItems/200--Hostname.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/StartupItems/200--Hostname.js b/StartupItems/200--Hostname.js new file mode 100644 index 0000000..9148c7d --- /dev/null +++ b/StartupItems/200--Hostname.js @@ -0,0 +1,6 @@ +const fs = require("fs"); +log("MistyCore-Startup-Hostname", "Setting hostname to " + require('fs').readFileSync(systemRoot + "/Preferences/Hostname").toString().trim()); +require('child_process').execFileSync("/System/Binaries/hostname", [ "--", require('fs').readFileSync(systemRoot + "/Preferences/Hostname").toString().trim() ]); +global.hostname = require('fs').readFileSync(systemRoot + "/Preferences/Hostname").toString().trim(); +fs.writeFileSync(systemRoot + "/../Volumes/VM/Hostname", hostname); +log("MistyCore-Startup-Hostname", "Set hostname successfully");
\ No newline at end of file |