Created
May 16, 2023 10:07
-
-
Save suresh-sendinblue/2bf08097462010c2770abd12333b8ac3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dns = require('dns') | |
| client_id=parseInt(process.argv[2] || 'xxxxxx') | |
| function callMe() { | |
| const strToExec = 'emailing.' + client_id + '.connectionstring.v2.production.cache.sib.'; | |
| dns.resolveTxt(strToExec, (error, stdout) => { | |
| stdout = stdout && stdout[0] && stdout[0][0] | |
| if (error || !stdout) { | |
| console.log('some error occured while trying to get connection string from DNS cache' + error) | |
| return error, stdout | |
| } | |
| if (stdout === '_NOT_FOUND_') { | |
| console.log('connection string not found') | |
| stdout = null | |
| } | |
| console.log(stdout) | |
| callMe() | |
| }) | |
| } | |
| callMe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment