From edfedc5c064d38157f2abe5306297866e7e74b91 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 00:10:26 +0200 Subject: [PATCH] in theory finish os_version Signed-off-by: Nico Schottelius --- conf/explorer/os_version | 73 +++++++++------------------------------- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/conf/explorer/os_version b/conf/explorer/os_version index 02e2e2cd..5f7120c0 100755 --- a/conf/explorer/os_version +++ b/conf/explorer/os_version @@ -27,66 +27,25 @@ case "$($__explorer/os)" in # empty, but well... cat /etc/arch-release ;; - macosx|openbsd) + debian) + cat /etc/debian_version + ;; + fedora) + cat /etc/fedora-release + ;; + gentoo) + cat /etc/gentoo-release + ;; + macosx|*bsd|solaris) uname -r ;; -esac - -exit 0 - -# Ubuntu is also Debian, thus return if Ubuntu was found -if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then - echo ubuntu - exit 0 -fi - -if [ -f /etc/debian_version ]; then - echo debian - exit 0 -fi - -if [ -f /etc/gentoo-release ]; then - echo gentoo - exit 0 -fi - -# Fedora is also Redhat, thus return before redhat! -if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then - echo fedora - exit 0 -fi - -if [ -f /etc/redhat-release ]; then - echo redhat - exit 0 -fi - -if [ -f /etc/SuSE-release ]; then - echo suse - exit 0 -fi - -uname_s="$(uname -s)" - -# Assume there is no tr on the client -> do lower case ourselves -case "$uname_s" in - NetBSD) - echo netbsd - exit 0 + redhat) + cat /etc/redhat-release ;; - FreeBSD) - echo freebsd - exit 0 + suse) + cat /etc/SuSE-release ;; - OpenBSD) - echo openbsd - exit 0 - ;; - SunOS) - echo solaris - exit 0 + ubuntu) + lsb_release -sr ;; esac - -echo "Unknown OS" >&2 -exit 1