Add route to set/get sysinfo
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getServerIp: getServerIp
|
||||
getServerIp,
|
||||
testConfig
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
@@ -23,3 +24,12 @@ function getServerIp(config, callback) {
|
||||
|
||||
return callback(null, addresses[0]);
|
||||
}
|
||||
|
||||
function testConfig(config, callback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
if (typeof config.ifname !== 'string') return callback(new BoxError(BoxError.BAD_FIELD, 'ifname is not a string'));
|
||||
|
||||
callback(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user