From 5e7e1f9423f6a1a0f8ee51ca3c6f120081726fe3 Mon Sep 17 00:00:00 2001 From: rkaldung Date: Mon, 11 Aug 2014 14:33:29 +0200 Subject: [PATCH] added distro detection --- script/install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/script/install.sh b/script/install.sh index 05a7907cf..aee26438a 100644 --- a/script/install.sh +++ b/script/install.sh @@ -1,2 +1,15 @@ #!/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 +}