Commit 46087d220e136fc89f05d1c542ae16723240d692

Authored by Adhidarma Hadiwinoto
1 parent f1510ef10d
Exists in master

write to config tmp before install

Showing 2 changed files with 4 additions and 1 deletions Side-by-side Diff

lib/apiserver/routers/smstools-config.js
... ... @@ -137,8 +137,10 @@ async function pageModemDelete(req, res) {
137 137 });
138 138 }
139 139  
140   -function pageInstallConfig(req, res) {
  140 +async function pageInstallConfig(req, res) {
141 141 logger.info('ROUTER-SMSTOOLS-CONFIG: Going to write configuration and restart smsd service');
  142 + await smstoolsConfigSetter.writeConfig();
  143 +
142 144 const fileToExec = `${process.cwd()}/bin/smstools-config-install`;
143 145 childProcess.execFile(fileToExec, [config.smstools_config_file || '/etc/smsd.conf'], (err, stdout, stderr) => {
144 146 res.json({
lib/smstools-config/setter.js
... ... @@ -25,6 +25,7 @@ async function writeConfig() {
25 25  
26 26 return null;
27 27 }
  28 +exports.writeConfig = writeConfig;
28 29  
29 30 exports.set = async (keyword, value) => {
30 31 if (!keyword) return smstoolsConfigData;