Commit e3ee5d82b74e67ee33913142974e76c82168a68a
1 parent
8e9f7cf70e
Exists in
master
Cek device ada tidak pada index.js
Showing 1 changed file with 6 additions and 1 deletions Inline Diff
index.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | process.chdir(__dirname); | 3 | process.chdir(__dirname); |
4 | require('fs').writeFileSync('pid.txt', process.pid); | 4 | const fs = require('fs') |
5 | |||
6 | fs.writeFileSync('pid.txt', process.pid); | ||
5 | 7 | ||
6 | const path = require('path'); | 8 | const path = require('path'); |
7 | const config = require('komodo-sdk/config'); | 9 | const config = require('komodo-sdk/config'); |
8 | 10 | ||
9 | process.title = `KOMODO-MODEM@${(typeof config.name === 'string') ? config.name.toUpperCase() : path.basename(config.modem.device).toUpperCase()}`; | 11 | process.title = `KOMODO-MODEM@${(typeof config.name === 'string') ? config.name.toUpperCase() : path.basename(config.modem.device).toUpperCase()}`; |
12 | if (!fs.existsSync(config.modem.device)) { | ||
13 | process.exit(4); | ||
14 | } | ||
10 | 15 | ||
11 | require('./lib/http-command-server'); | 16 | require('./lib/http-command-server'); |
12 | require('./lib/modem'); | 17 | require('./lib/modem'); |
13 | 18 |