VBoxSysInfo.sh revision 76c869b82c29ec35452aa898ae9fdf303defc00a
# @file
#
# Installer (Unix-like)
# Copyright (C) 2006-2007 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Print information about a Linux system
# @param distribution name of the distribution
# @param version version of the distribution
# The following regex is not quite correct for an e-mail address, as
# the local part may not start or end with a dot. Please correct if
# this upsets you.
echo "Distribution: $1 | Version: $2 | Kernel: $kern_ver"
}
# Determine the distribution name and release for a Linux system and print
# send the information to stdout using the print_linux_info function.
# For practical reasons (i.e. lack of time), this function only gives
# information for distribution releases considered "of interest" and reports
# others as unknown. It can be extended later if other distributions are
# found to be "of interest".
if which lsb_release > /dev/null 2>&1
then
# LSB-compliant system
elif [ -r /etc/debian_version ]
then
# Debian-based system
elif [ -r /etc/mandriva-release ]
then
# Mandriva-based system
elif [ -r /etc/fedora-release ]
then
# Fedora-based
elif [ -r /etc/SuSE-release ]
then
# SUSE-based.
if grep openSUSE /etc/SuSE-release
then
# Is it worth distinguishing here? I did it mainly to prevent
# confusion with the version number
else
fi
elif [ -r /etc/gentoo-release ]
then
# Gentoo-based
elif [ -r /etc/slackware-version ]
then
# Slackware
elif [ -r /etc/arch-release ]
then
# Arch Linux
print_linux_info "Arch Linux" "none"
elif [ -r /etc/redhat-release ]
then
# Redhat-based. This should come near the end, as it other
# distributions may give false positives.
else
print_linux_info "unknown" "unknown"
fi
}
# Print information about a Solaris system. FIXME.
echo "Kernel: $kernel"
}
# Print information about a MacOS system. FIXME.
}
# Print information about a FreeBSD system. FIXME.
echo "Kernel: $kernel"
}
;;
;;
;;
;;
*)
echo "System unknown"
exit 1
;;
esac
exit 0