Skip to content
Snippets Groups Projects
Commit 6d8594ac authored by Ferenc Schulcz's avatar Ferenc Schulcz
Browse files

Bugfix: do not unset previous record if nonexistent

parent 0dbe3e24
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,11 @@ const config = require('./config');
async function updateRecord(domain, ip) {
await exec("/usr/sbin/knotc zone-begin " + config.config().higherLevelDomain);
try {
await exec("/usr/sbin/knotc zone-unset " + config.config().higherLevelDomain + " " + domain);
} catch {
console.log("Could not unset domain " + domain);
}
await exec("/usr/sbin/knotc zone-set " + config.config().higherLevelDomain + " " + domain + " 60 A " + ip);
await exec("/usr/sbin/knotc zone-commit " + config.config().higherLevelDomain);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment