I saw this post on all the different ways to find out what distro is installed, so I'm trying to write a script that tries them all. The possible commands include:
$ cat /etc/lsb-release
$ cat /etc/issue
$ dmesg | head -1
$ cat /proc/version
$ cat /etc/slackware-version
$ cat/etc/debian-verion
I tried writing something like this (I speak Spanish normally, so it's in Spanish):
function Nombre_SO()
{
DistroName="Linux"
if [ $DistroName = Linux ] ;
then
# Debian
debian=`cat /etc/debian_version | cut -d " " -f01 | tr '[:upper:]' '[:lower:]'`
if [ "$debian" = "debian" || "squeeze/sid" || "lenny" ];
then
DistroName="debian"
else
echo "Esto no es debian"
fi
# Slackware
slackware=`cat /etc/slackware-version | cut -d " " -f01` | tr '[:upper:]' '[:lower:]'`
if [ "$slackware" = "slackware" || "slackware-x86_64" ];
then
DistroName="slackware"
else
echo "Esto no es Slackware"
}
Can someone help me incorporate all the other ways to get a distro's name?