mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-03 05:12:42 +00:00
fixes certbot script
This commit is contained in:
1 parent
75127dc02e
commit
0619f909ee
4 files changed
+2985
-3054
No files matched your search
+22
-10
@@ -32,16 +32,28 @@ update_record() {
|
||||
echo "
|
||||
const { domainService } = require('./utils/domain-service');
|
||||
const { ENV, DOMAIN_DOMAIN } = require('./utils/constants');
|
||||
const record = {
|
||||
name: '$name',
|
||||
type: '$type',
|
||||
address: '$address',
|
||||
ttl: $ttl,
|
||||
};
|
||||
console.log('Uploading $name to', DOMAIN_DOMAIN, '(', ENV, ')...');
|
||||
domainService.$method(record)()
|
||||
.then(d => console.log(d.cpanelresult ? d.cpanelresult.data : d))
|
||||
.catch(console.error);
|
||||
const method = '$method';
|
||||
const name = '$name';
|
||||
const type = '$type';
|
||||
|
||||
const record = { name, type, address: '$address', ttl: $ttl };
|
||||
|
||||
async function main() {
|
||||
if (method === 'removeZoneRecord') {
|
||||
const data = await domainService.get({ customonly: 0, name: '$name.is-a.dev.', type });
|
||||
if (data.length > 0) {
|
||||
record.id = data[0].line;
|
||||
} else {
|
||||
throw new Error('Unable to find record');
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Uploading $name to', DOMAIN_DOMAIN, '(', ENV, ')...');
|
||||
const data = await domainService[method](record)();
|
||||
console.log(data.cpanelresult ? data.cpanelresult.data : data);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
" | node -
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user