-
Notifications
You must be signed in to change notification settings - Fork 11
/
hepop.js
executable file
·35 lines (28 loc) · 1009 Bytes
/
hepop.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env node
/*
* HEP Op
* (c) 2018 QXIP BV
* See LICENSE for details
*/
//'use strict';
const program = require('commander');
const setConfig = require('./src/config').setConfig;
const getConfig = require('./src/config').getConfig;
const pkg = require('./package.json');
const servers = require('./src/servers');
const select = servers.select;
program
.version(pkg.version)
.option('-p, --port <number>', 'port to listen on', Number, 9060)
.option('-a, --address <address>', 'network address to listen on', String, '127.0.0.1')
.option('-d, --dbName <address>', 'database name', String, 'hepic')
.option('-t, --tableName <address>', 'database table name', String, 'hep')
.option('-c, --configfile <configfile>', 'configuration file', String)
.option('-s, --socket <socket>', 'socket service (udp,tcp,http,https,sipfix)', String, 'udp')
.parse(process.argv)
if (!program.socket||!program.configfile) {
program.help()
} else {
setConfig(program);
select(getConfig());
}