Commit 3c86625d authored by jan.koester's avatar jan.koester
Browse files

now distro info included

parent a7c0510a
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/

#include <fstream>
#include <cstring>
#include <string>
#include <vector>
@@ -36,6 +37,8 @@
#include "theme.h"
#include "conf.h"

#define RELEASEFILE "/etc/os-release"

namespace blogi {
    class NodeInfo : public PluginApi {
    public:
@@ -80,6 +83,20 @@ namespace blogi {
            htmltable << libhtmlpp::HtmlTable::Row() << "Release Version :" << usysinfo.release;
            htmltable << libhtmlpp::HtmlTable::Row() << "Hardware        :" << usysinfo.machine;

            std::fstream osr(RELEASEFILE);
            std::string osline;

            if(osr.is_open()){
                while ( getline (osr,osline) ){
                    std::string name,entry;
                    int deli=osline.find('=');
                    name=osline.substr(0,deli);
                    entry=osline.substr(deli+1,osline.length()-(deli+1));
                    htmltable << libhtmlpp::HtmlTable::Row() << name.c_str() << entry.c_str();
                }
            }


            long psize;
            if((psize=sysconf(_SC_PAGESIZE))>0){
                char ab[512];