-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yet some changes. See changelog for details
- Loading branch information
Showing
8 changed files
with
1,145 additions
and
866 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
[ | ||
".mp3", ".ogg", ".opus", ".aac", ".m4a", ".wav", ".flac", ".ape", ".wv", ".oga", ".webm" | ||
".mp3", | ||
".ogg", | ||
".opus", | ||
".aac", | ||
".m4a", | ||
".wav", | ||
".flac", | ||
".ape", | ||
".wv", | ||
".oga", | ||
".webm" | ||
] |
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,31 +1,33 @@ | ||
// https://wiki.unix7.org/node/daemon-sample | ||
var child_process = require('child_process'); | ||
var { writeFileSync } = require('fs'); | ||
var child_process = require("child_process"); | ||
var { writeFileSync } = require("fs"); | ||
|
||
function child(exe, args, env) { | ||
var child = child_process.spawn(exe, args, { | ||
detached: true, | ||
stdio: ['ignore', 'ignore', 'ignore'], | ||
env: env | ||
}) | ||
child.unref() | ||
return child | ||
} | ||
|
||
module.exports = function(nodeBin) { | ||
console.log('Daemon PID :', process.pid); | ||
console.log('Daemon PPID:', process.ppid); | ||
console.log(`\nTo kill server, Run \"openradio-pulse -k\"`); | ||
writeFileSync(process.env.TMPDIR + "/openradio-pulse-daemon.json", JSON.stringify({ pid: process.pid, ppid: process.ppid })); | ||
|
||
if (process.env.__daemon) { | ||
return process.pid | ||
} | ||
process.env.__daemon = true | ||
|
||
var args = [].concat(process.argv) | ||
var node = args.shift() | ||
var env = process.env | ||
child(node, args, env) | ||
return process.exit() | ||
var child = child_process.spawn(exe, args, { | ||
detached: true, | ||
stdio: ["ignore", "ignore", "ignore"], | ||
env: env, | ||
}); | ||
child.unref(); | ||
return child; | ||
} | ||
|
||
module.exports = function (nodeBin) { | ||
console.log("Daemon PID :", process.pid); | ||
console.log(`\nTo kill server, Run \"openradio-pulse -k\"`); | ||
writeFileSync( | ||
process.env.TMPDIR + "/openradio-pulse-daemon.json", | ||
JSON.stringify({ pid: process.pid }) | ||
); | ||
|
||
if (process.env.__daemon) { | ||
return process.pid; | ||
} | ||
process.env.__daemon = true; | ||
|
||
var args = [].concat(process.argv); | ||
var node = args.shift(); | ||
var env = process.env; | ||
child(node, args, env); | ||
return process.exit(); | ||
}; |
Oops, something went wrong.