/DistributionChecker

A small library that helps you check your running distribution.

Primary LanguageC#MIT LicenseMIT

DistributionChecker

A small library that helps you check your running distribution. Demo

Nuget

Install :

dotnet add package HCGStudio.DistributionChecker

Usage :

var distribution = new DistributionChecker().GetDistribution();

And you will get all the information you need.

We also have some Extenstion methods such as:

distribution.IsUbuntu();
distribution.IsLikeRedHat();
distribution.IsOrLikeArchLinux();
//...
//Of course there are some more!

These methods work just like their names.

How it works

It reads your /etc/os-release and parase with DFA. Information about os-release was found at https://www.freedesktop.org/software/systemd/man/os-release.html and many XML documents are from it.