Commit 964b68ec7fda5ae3d50a10d9cb5017dc6ef76810

Authored by Adhidarma Hadiwinoto
1 parent 77ec494b8d
Exists in master

smsd-config-generator

Showing 1 changed file with 20 additions and 0 deletions Side-by-side Diff

bin/smsd-config-generator.js
... ... @@ -0,0 +1,20 @@
  1 +/* eslint-disable no-console */
  2 +process.chdir(`${__dirname}/..`);
  3 +
  4 +const config = require('komodo-sdk/config');
  5 +
  6 +const result = [];
  7 +(config.modems || []).forEach((modem) => {
  8 + const isOutgoing = config.outgoing_modems && (config.outgoing_modems.indexOf(modem) >= 0) ? 'yes' : 'no';
  9 +
  10 + const content = `
  11 +[${modem}]
  12 +device = /dev/tty${modem}
  13 +incoming = yes
  14 +outgoing = ${isOutgoing}
  15 + `.trim();
  16 +
  17 + result.push(content);
  18 +});
  19 +
  20 +console.log(result.join('\n\n'));