added distro detection

This commit is contained in:
rkaldung 2014-08-11 14:33:29 +02:00
parent 7f0a6a5e05
commit 5e7e1f9423

View file

@ -1,2 +1,15 @@
#!/bin/bash #!/bin/bash
get_distro(){
arch=$(uname -m)
kernel=$(uname -r)
if [ -f /etc/lsb-release ]; then
os=$(lsb_release -s -d)
elif [ -f /etc/debian_version ]; then
os="Debian $(cat /etc/debian_version)"
elif [ -f /etc/redhat-release ]; then
os=`cat /etc/redhat-release`
else
os="$(uname -s) $(uname -r)"
fi
}