Add route to set/get sysinfo

This commit is contained in:
Girish Ramakrishnan
2019-10-29 20:08:45 -07:00
parent 813454ca82
commit 8232d471a3
9 changed files with 97 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
exports = module.exports = {
getServerIp: getServerIp,
testConfig: testConfig,
hasIPv6: hasIPv6
};
@@ -41,3 +42,10 @@ function hasIPv6() {
// on contabo, /proc/net/if_inet6 is an empty file. so just exists is not enough
return fs.existsSync(IPV6_PROC_FILE) && fs.readFileSync(IPV6_PROC_FILE, 'utf8').trim().length !== 0;
}
function testConfig(config, callback) {
assert.strictEqual(typeof config, 'object');
assert.strictEqual(typeof callback, 'function');
api(config.provider).testConfig(config, callback);
}