summaryrefslogtreecommitdiff
path: root/src/sysinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysinfo.cpp')
-rw-r--r--src/sysinfo.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 82cdcf7..6e7ce54 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -420,6 +420,28 @@ namespace {
};
+ class OpenBSDSysInfo
+ : public SysInfo
+ {
+ public:
+ OpenBSDSysInfo()
+ {
+ this->load_openbsd_info();
+ }
+
+ private:
+ void load_openbsd_info()
+ {
+ this->distro_name = "OpenBSD";
+ this->distro_release = this->kernel;
+
+ std::ifstream input("/etc/motd");
+
+ if (input)
+ std::getline(input, this->kernel);
+ }
+ };
+
SysInfo* get_sysinfo()
{
if (g_file_test ("/etc/os-release", G_FILE_TEST_EXISTS)) {
@@ -435,6 +457,9 @@ namespace {
else if (SysInfo::system() == "NetBSD") {
return new NetBSDSysInfo;
}
+ else if (SysInfo::system() == "OpenBSD") {
+ return new OpenBSDSysInfo;
+ }
return new SysInfo;
}