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 Side-by-side Diff
index.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | 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 | 8 | const path = require('path'); |
7 | 9 | const config = require('komodo-sdk/config'); |
8 | 10 | |
9 | 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 | 16 | require('./lib/http-command-server'); |
12 | 17 | require('./lib/modem'); |