add stuff
This commit is contained in:
parent
26724e0551
commit
b28a45581f
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
// dig -p 53 @redirect-www.org pi.nadal.daplie.com A
|
||||
var updateIp = require('./holepunch/helpers/update-ip.js').update;
|
||||
|
||||
var redirects = require('./redirects');
|
||||
var ddns = [];
|
||||
var ddnsMap = {};
|
||||
|
||||
function add(hostname) {
|
||||
ddns.push({
|
||||
"name": hostname
|
||||
});
|
||||
}
|
||||
redirects.forEach(function (r) {
|
||||
if (!ddnsMap[r.from.hostname.toLowerCase()]) {
|
||||
add(r.from.hostname);
|
||||
}
|
||||
if (!ddnsMap[r.to.hostname.toLowerCase()]) {
|
||||
add(r.to.hostname);
|
||||
}
|
||||
});
|
||||
|
||||
return updateIp({
|
||||
updater: 'redirect-www.org'
|
||||
, port: 65443
|
||||
, cacert: null
|
||||
, ddns: ddns
|
||||
}).then(function (data) {
|
||||
if ('string') {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(data, null, ' '));
|
||||
console.log('Test with');
|
||||
console.log('dig <<hostname>> A');
|
||||
});
|
|
@ -41,6 +41,7 @@
|
|||
"check-ip-address": "^1.0.0",
|
||||
"cli": "^0.6.5",
|
||||
"connect": "^3.3.4",
|
||||
"escape-string-regexp": "^1.0.2",
|
||||
"express": "^4.11.2",
|
||||
"foreachasync": "^5.0.5",
|
||||
"request": "^2.51.0",
|
||||
|
|
Loading…
Reference in New Issue