diff --git a/index.js b/index.js index 8f8c047..6c5d25f 100644 --- a/index.js +++ b/index.js @@ -38,13 +38,13 @@ function parseVoicemailData(data) { } function getUsers() { - var vmData = fs.readFileSync(process.env.DEV == "true" ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString() + var vmData = fs.readFileSync(process.env.DEV ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString() voicemailData = parseVoicemailData(extractTextFromRawText(vmData)); return voicemailData; } function getEndpoints() { - if (!process.env.DEV == "true") { + if (!process.env.DEV) { const currentEndpoint = execSync('asterisk -x "pjsip show endpoints"').toString(); const endpoints = currentEndpoint.split("\n"); return endpoints; @@ -142,7 +142,7 @@ function renderStatusPage() { if (err) { console.error(err); } else { - fs.writeFileSync(process.env.DEV == "true" ? "./dev/index.html" : "/var/www/html/status/index.html", str); + fs.writeFileSync(process.env.DEV ? "./dev/index.html" : "/var/www/html/status/index.html", str); } }); } @@ -155,7 +155,7 @@ client.on("ready", () => { setInterval(renderStatusPage, 5*1000); }); -if (process.env.DEV == "true") { +if (process.env.DEV) { console.log("DEV") renderStatusPage(); notifyNew();