Blame view
index.js
798 Bytes
49eaf19a3
|
1 2 3 |
'use strict'; process.chdir(__dirname); |
ce817b0cf
|
4 |
const fs = require('fs'); |
e3ee5d82b
|
5 6 |
fs.writeFileSync('pid.txt', process.pid); |
c883b5cc4
|
7 |
|
966ecafc0
|
8 |
const path = require('path'); |
158c5b010
|
9 |
const config = require('komodo-sdk/config'); |
49eaf19a3
|
10 |
|
8f6ae506e
|
11 12 13 14 15 |
if (!config || !config.modem || !config.modem.device || !fs.existsSync(config.modem.device) ) { |
e3ee5d82b
|
16 17 |
process.exit(4); } |
966ecafc0
|
18 |
|
8f6ae506e
|
19 20 21 22 23 24 25 |
process.title = (typeof config.name === 'string' && config.name.trim()) ? config.name.toUpperCase() : `MODEM-${path.basename(config.modem.device).replace('tty', '').toUpperCase()}`; global.KOMODO_LOG_LABEL = (typeof config.name === 'string' && config.name.trim()) ? `KOMODO-MODEM@${config.name.toUpperCase()}` : `KOMODO-MODEM@${path.basename(config.modem.device).replace('tty', '').toUpperCase()}`; |
e3bb6fdba
|
26 |
|
56758af44
|
27 |
require('./lib/http-command-server'); |
49eaf19a3
|
28 |
require('./lib/modem'); |