in theory finish os_version

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-04-05 00:10:26 +02:00
parent b474960774
commit edfedc5c06

View file

@ -27,66 +27,25 @@ case "$($__explorer/os)" in
# empty, but well... # empty, but well...
cat /etc/arch-release 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 uname -r
;; ;;
esac redhat)
cat /etc/redhat-release
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
;; ;;
FreeBSD) suse)
echo freebsd cat /etc/SuSE-release
exit 0
;; ;;
OpenBSD) ubuntu)
echo openbsd lsb_release -sr
exit 0
;;
SunOS)
echo solaris
exit 0
;; ;;
esac esac
echo "Unknown OS" >&2
exit 1