37 lines
924 B
JavaScript
Executable File
37 lines
924 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const server = require('./server.js');
|
|
|
|
const argv = require('yargs')
|
|
.default('port', 2514, 'The port to listen on') // syslog is 514 so we prefix with 2
|
|
.default('logdir', '/tmp/logs', 'The root log directory')
|
|
.argv;
|
|
|
|
const options = {
|
|
logFolder: argv.logdir,
|
|
port: argv.port
|
|
};
|
|
|
|
if (argv.version) {
|
|
console.log('1.0.1');
|
|
process.exit(0);
|
|
}
|
|
|
|
console.log();
|
|
console.log('==========================================');
|
|
console.log(' Cloudron Syslog Daemon ');
|
|
console.log('==========================================');
|
|
console.log();
|
|
console.log(' Log Folder: ', options.logFolder);
|
|
console.log(' UDP Port: ', options.port);
|
|
console.log();
|
|
console.log('==========================================');
|
|
console.log();
|
|
|
|
server.start(options, function (error) {
|
|
if (error) return console.error(error);
|
|
console.log('Listening...');
|
|
});
|