system: show the kernel version
This commit is contained in:
@@ -56,6 +56,7 @@ async function clearLocation() {
|
||||
|
||||
async function getConfig() {
|
||||
const ubuntuVersion = await system.getUbuntuVersion();
|
||||
const kernelVersion = await system.getKernelVersion();
|
||||
const profileConfig = await userDirectory.getProfileConfig();
|
||||
const externalLdapConfig = await externalLdap.getConfig();
|
||||
|
||||
@@ -71,6 +72,7 @@ async function getConfig() {
|
||||
mailFqdn: (await mailServer.getLocation()).fqdn,
|
||||
version: constants.VERSION,
|
||||
ubuntuVersion,
|
||||
kernelVersion,
|
||||
isDemo: constants.DEMO,
|
||||
cloudronName: await branding.getCloudronName(),
|
||||
footer: await branding.renderFooter(),
|
||||
|
||||
@@ -4,6 +4,7 @@ exports = module.exports = {
|
||||
reboot,
|
||||
getInfo,
|
||||
getUbuntuVersion,
|
||||
getKernelVersion,
|
||||
getSwaps,
|
||||
checkDiskSpace,
|
||||
getMemory,
|
||||
@@ -358,6 +359,13 @@ async function checkRebootRequired() {
|
||||
}
|
||||
}
|
||||
|
||||
async function getKernelVersion() {
|
||||
const data = safe.fs.readFileSync('/proc/version', 'utf-8');
|
||||
if (data === null) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
|
||||
const version = data.match(/^Linux version (\S+)/)[1];
|
||||
return `Linux ${version}`;
|
||||
}
|
||||
|
||||
async function getUbuntuVersion() {
|
||||
const release = safe.fs.readFileSync('/etc/lsb-release', 'utf-8');
|
||||
if (release === null) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
|
||||
|
||||
Reference in New Issue
Block a user