mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Moving stuff around
This commit is contained in:
parent
6dd0cd2bab
commit
0d8c1c154a
11 changed files with 17 additions and 17 deletions
24
utils/motd.js
Normal file
24
utils/motd.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
const utils = require('./utils.js');
|
||||
const dataFile = "public/data.json";
|
||||
const versionFile = "public/version";
|
||||
const motdFile = "public/motd";
|
||||
|
||||
var p = GetParams();
|
||||
if (p.length <= 0) {
|
||||
console.log("no params!");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
|
||||
var param = p.join(" ");
|
||||
console.log("param: " + param);
|
||||
var d = utils.ReadFile(dataFile);
|
||||
var parsed = JSON.parse(d);
|
||||
parsed.motd = param;
|
||||
utils.WriteFile(JSON.stringify(parsed), dataFile);
|
||||
|
||||
utils.WriteFile(parsed.motd, motdFile);
|
||||
|
||||
function GetParams() {
|
||||
return process.argv.splice(2);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue