Add config.hasIPv6()

This commit is contained in:
Johannes Zellner
2017-09-29 19:12:53 +02:00
parent 4a5cbab194
commit 78fb9401ee
3 changed files with 10 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ exports = module.exports = {
appFqdn: appFqdn,
zoneName: zoneName,
setZoneName: setZoneName,
hasIPv6: hasIPv6,
isDemo: isDemo,
@@ -232,3 +233,8 @@ function tlsKey() {
var keyFile = path.join(baseDir(), 'configs/host.key');
return safe.fs.readFileSync(keyFile, 'utf8');
}
function hasIPv6() {
// require here to avoid cyclic dependencies, it is cached anyways
return fs.existsSync(require('./paths.js').IPV6_PROC_FILE);
}