-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from fdm-monster/feat/fdm-monster-1.5.0-rc1
fix: prepare to convert MonsterPi for 1.5.0-rc2 dist install
- Loading branch information
Showing
12 changed files
with
355 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 15 additions & 17 deletions
32
src/modules/monsterpi/filesystem/home/pi/fdm-monster-daemon/install-fdm-monster.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
/** | ||
* Created by D. Zwart | ||
* Description: Installs the Linux Service for MonsterPi's FDM Monster | ||
* v1.0 | ||
* 05/05/2023 | ||
* v2.0 | ||
* 14/10/2023 | ||
*/ | ||
|
||
const { Service } = require('node-linux'); | ||
const { Service } = require("node-linux"); | ||
const { join } = require("path"); | ||
|
||
// Create a new service object | ||
const rootPath = join(__dirname, "../fdm-monster/server/"); | ||
const rootPath = join(__dirname, "../fdm-monster/dist-active"); | ||
const svc = new Service({ | ||
name: 'FDM Monster', | ||
description: "The 3D Printer Farm server for managing your 100+ OctoPrints printers.", | ||
script: join(rootPath, "index.mjs"), | ||
nodeOptions: [ | ||
'--harmony', | ||
'--max_old_space_size=4096' | ||
], | ||
workingDirectory: rootPath, | ||
name: "FDM Monster", | ||
description: | ||
"The 3D Printer Farm server for managing your 100+ OctoPrints printers.", | ||
script: join(rootPath, "dist/index.js"), | ||
nodeOptions: ["--harmony", "--max_old_space_size=4096"], | ||
workingDirectory: rootPath, | ||
}); | ||
|
||
svc.on('install', function () { | ||
svc.start(); | ||
console.log("Install complete. Service exists:", svc.exists()); | ||
console.log("Service running: ", svc.isRunning); | ||
svc.on("install", function () { | ||
svc.start(); | ||
console.log("Install complete. Service exists:", svc.exists()); | ||
console.log("Service running: ", svc.isRunning); | ||
}); | ||
|
||
if (svc.exists()) { | ||
svc.uninstall(); | ||
svc.uninstall(); | ||
} | ||
|
||
svc.install(); |
56 changes: 56 additions & 0 deletions
56
src/modules/monsterpi/filesystem/home/pi/fdm-monster-daemon/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 7 additions & 5 deletions
12
src/modules/monsterpi/filesystem/home/pi/fdm-monster-daemon/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{ | ||
"name": "fdm-monster-daemon", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Daemon service wrapper ", | ||
"main": "./install-fdm-monster.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"install": "node ./install-fdm-monster.js", | ||
"uninstall": "node ./uninstall-fdm-monster.js" | ||
"install": "node ./install-fdm-monster.js", | ||
"uninstall": "node ./uninstall-fdm-monster.js" | ||
}, | ||
"dependencies": {} | ||
} | ||
"dependencies": { | ||
"node-linux": "^0.1.12" | ||
} | ||
} |
30 changes: 14 additions & 16 deletions
30
src/modules/monsterpi/filesystem/home/pi/fdm-monster-daemon/uninstall-fdm-monster.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
/** | ||
* Created by D. Zwart | ||
* Description: Uninstalls the Linux Service for MonsterPi's FDM Monster | ||
* v1.0 | ||
* 05/05/2023 | ||
* v2.0 | ||
* 14/10/2023 | ||
*/ | ||
|
||
const { Service } = require('node-linux'); | ||
const { Service } = require("node-linux"); | ||
const { join } = require("path"); | ||
|
||
// Create a new service object | ||
const rootPath = join(__dirname, "../fdm-monster/server/"); | ||
const rootPath = join(__dirname, "../fdm-monster/dist-active"); | ||
const svc = new Service({ | ||
name: 'FDM Monster', | ||
description: "The 3D Printer Farm server for managing your 100+ OctoPrints printers.", | ||
script: join(rootPath, "index.mjs"), | ||
nodeOptions: [ | ||
'--harmony', | ||
'--max_old_space_size=4096' | ||
], | ||
workingDirectory: rootPath, | ||
name: "FDM Monster", | ||
description: | ||
"The 3D Printer Farm server for managing your 100+ OctoPrints printers.", | ||
script: join(rootPath, "dist/index.js"), | ||
nodeOptions: ["--harmony", "--max_old_space_size=4096"], | ||
workingDirectory: rootPath, | ||
}); | ||
|
||
svc.on('install', function () { | ||
svc.start(); | ||
console.log("Install complete. Service exists:", svc.exists()); | ||
console.log("Service running: ", svc.isRunning); | ||
svc.on("install", function () { | ||
svc.start(); | ||
console.log("Install complete. Service exists:", svc.exists()); | ||
console.log("Service running: ", svc.isRunning); | ||
}); | ||
|
||
svc.uninstall(); |
Oops, something went wrong.